forked from rust-lang/rust
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Rollup merge of rust-lang#62963 - estebank:homoglyph-recovery, r=petr…
…ochenkov Allow lexer to recover from some homoglyphs
- Loading branch information
Showing
6 changed files
with
89 additions
and
36 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1 change: 1 addition & 0 deletions
1
src/test/ui/did_you_mean/issue-49746-unicode-confusable-in-float-literal-expt.rs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,6 @@ | ||
const UNIVERSAL_GRAVITATIONAL_CONSTANT: f64 = 6.674e−11; // m³⋅kg⁻¹⋅s⁻² | ||
//~^ ERROR expected at least one digit in exponent | ||
//~| ERROR unknown start of token: \u{2212} | ||
//~| ERROR cannot subtract `{integer}` from `{float}` | ||
|
||
fn main() {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
fn main() { | ||
println!(""); //~ ERROR unknown start of token: \u{37e} | ||
let x: usize = (); //~ ERROR mismatched types | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
error: unknown start of token: \u{37e} | ||
--> $DIR/recover-from-homoglyph.rs:2:17 | ||
| | ||
LL | println!(""); | ||
| ^ | ||
help: Unicode character ';' (Greek Question Mark) looks like ';' (Semicolon), but it is not | ||
| | ||
LL | println!(""); | ||
| ^ | ||
|
||
error[E0308]: mismatched types | ||
--> $DIR/recover-from-homoglyph.rs:3:20 | ||
| | ||
LL | let x: usize = (); | ||
| ^^ expected usize, found () | ||
| | ||
= note: expected type `usize` | ||
found type `()` | ||
|
||
error: aborting due to 2 previous errors | ||
|
||
For more information about this error, try `rustc --explain E0308`. |