-
Notifications
You must be signed in to change notification settings - Fork 13k
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 #100230 - cjgillot:noice-multibyte-amp, r=compiler-er…
…rors Use start_point instead of next_point to point to elided lifetime amp… Using `next_point` creates a span which points inside the multibyte token, ICEing. Fixes #100224
- Loading branch information
Showing
4 changed files
with
35 additions
and
2 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
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,7 @@ | ||
// Verify that we do not ICE when the user uses a multubyte ampersand. | ||
|
||
fn f(_: &&()) -> &() { todo!() } | ||
//~^ ERROR unknown start of token: \u{ff06} | ||
//~| ERROR missing lifetime specifier [E0106] | ||
|
||
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
error: unknown start of token: \u{ff06} | ||
--> $DIR/fullwidth-ampersand.rs:3:10 | ||
| | ||
LL | fn f(_: &&()) -> &() { todo!() } | ||
| ^^ | ||
| | ||
help: Unicode character '&' (Fullwidth Ampersand) looks like '&' (Ampersand), but it is not | ||
| | ||
LL | fn f(_: &&()) -> &() { todo!() } | ||
| ~ | ||
|
||
error[E0106]: missing lifetime specifier | ||
--> $DIR/fullwidth-ampersand.rs:3:18 | ||
| | ||
LL | fn f(_: &&()) -> &() { todo!() } | ||
| ----- ^ expected named lifetime parameter | ||
| | ||
= help: this function's return type contains a borrowed value, but the signature does not say which one of argument 1's 2 lifetimes it is borrowed from | ||
help: consider introducing a named lifetime parameter | ||
| | ||
LL | fn f<'a>(_: &'a &'a ()) -> &'a () { todo!() } | ||
| ++++ ++ ++ ++ | ||
|
||
error: aborting due to 2 previous errors | ||
|
||
For more information about this error, try `rustc --explain E0106`. |