rust/tests/ui/parser/misspelled-keywords/ref.stderr
Veera 14e86eb7d9 Add Suggestions for Misspelled Keywords
This PR detects misspelled keywords using two heuristics:

1. Lowercasing the unexpected identifier.
2. Using edit distance to find a keyword similar to the unexpected identifier.

However, it does not detect each and every misspelled keyword to
minimize false positives and ambiguities. More details about the
implementation can be found in the comments.
2024-09-06 23:07:45 -04:00

28 lines
865 B
Plaintext

error: expected one of `)`, `,`, `@`, or `|`, found `list`
--> $DIR/ref.rs:4:19
|
LL | Some(refe list) => println!("{list:?}"),
| ^^^^ expected one of `)`, `,`, `@`, or `|`
|
help: there is a keyword `ref` with a similar name
|
LL | Some(ref list) => println!("{list:?}"),
| ~~~
help: missing `,`
|
LL | Some(refe, list) => println!("{list:?}"),
| +
error[E0023]: this pattern has 2 fields, but the corresponding tuple variant has 1 field
--> $DIR/ref.rs:4:14
|
LL | Some(refe list) => println!("{list:?}"),
| ^^^^ ^^^^ expected 1 field, found 2
--> $SRC_DIR/core/src/option.rs:LL:COL
|
= note: tuple variant has 1 field
error: aborting due to 2 previous errors
For more information about this error, try `rustc --explain E0023`.