* Point at where the token was expected instead of the last token successfuly parsed. * Only show `unexpected token` if the next char and the unexpected token don't have the same span. * Change some cfail and pfail tests to ui test. * Don't show all possible tokens in span label if they are more than 6.
48 lines
1.8 KiB
Text
48 lines
1.8 KiB
Text
error: incorrect close delimiter: `}`
|
|
--> $DIR/token-error-correct-3.rs:29:9
|
|
|
|
|
29 | } else { //~ ERROR: incorrect close delimiter: `}`
|
|
| ^
|
|
|
|
|
note: unclosed delimiter
|
|
--> $DIR/token-error-correct-3.rs:23:21
|
|
|
|
|
23 | callback(path.as_ref(); //~ NOTE: unclosed delimiter
|
|
| ^
|
|
|
|
error: expected one of `,`, `.`, `?`, or an operator, found `;`
|
|
--> $DIR/token-error-correct-3.rs:23:35
|
|
|
|
|
23 | callback(path.as_ref(); //~ NOTE: unclosed delimiter
|
|
| ^ expected one of `,`, `.`, `?`, or an operator here
|
|
|
|
error: expected one of `.`, `;`, `?`, `}`, or an operator, found `)`
|
|
--> $DIR/token-error-correct-3.rs:29:9
|
|
|
|
|
25 | fs::create_dir_all(path.as_ref()).map(|()| true) //~ ERROR: mismatched types
|
|
| - expected one of `.`, `;`, `?`, `}`, or an operator here
|
|
...
|
|
29 | } else { //~ ERROR: incorrect close delimiter: `}`
|
|
| ^ unexpected token
|
|
|
|
error[E0425]: cannot find function `is_directory` in this scope
|
|
--> $DIR/token-error-correct-3.rs:21:13
|
|
|
|
|
21 | if !is_directory(path.as_ref()) { //~ ERROR: unresolved function `is_directory`
|
|
| ^^^^^^^^^^^^ not found in this scope
|
|
|
|
error[E0308]: mismatched types
|
|
--> $DIR/token-error-correct-3.rs:25:13
|
|
|
|
|
25 | fs::create_dir_all(path.as_ref()).map(|()| true) //~ ERROR: mismatched types
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected (), found enum `std::result::Result`
|
|
|
|
|
= note: expected type `()`
|
|
found type `std::result::Result<bool, std::io::Error>`
|
|
= help: here are some functions which might fulfill your needs:
|
|
- .unwrap()
|
|
- .unwrap_err()
|
|
- .unwrap_or_default()
|
|
|
|
error: aborting due to previous error
|
|
|