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#67010 - estebank:raw-idents, r=Centril
Accurately portray raw identifiers in error messages When refering to or suggesting raw identifiers, refer to them with `r#`. Fix rust-lang#65634.
- Loading branch information
Showing
9 changed files
with
61 additions
and
8 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
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 @@ | ||
#![allow(non_camel_case_types)] | ||
|
||
trait r#async { | ||
fn r#struct(&self) { | ||
println!("async"); | ||
} | ||
} | ||
|
||
trait r#await { | ||
fn r#struct(&self) { | ||
println!("await"); | ||
} | ||
} | ||
|
||
struct r#fn {} | ||
|
||
impl r#async for r#fn {} | ||
impl r#await for r#fn {} | ||
|
||
fn main() { | ||
r#fn {}.r#struct(); //~ ERROR multiple applicable items in scope | ||
} |
22 changes: 22 additions & 0 deletions
22
src/test/ui/issues/issue-65634-raw-ident-suggestion.stderr
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[E0034]: multiple applicable items in scope | ||
--> $DIR/issue-65634-raw-ident-suggestion.rs:21:13 | ||
| | ||
LL | r#fn {}.r#struct(); | ||
| ^^^^^^^^ multiple `r#struct` found | ||
| | ||
note: candidate #1 is defined in an impl of the trait `async` for the type `r#fn` | ||
--> $DIR/issue-65634-raw-ident-suggestion.rs:4:5 | ||
| | ||
LL | fn r#struct(&self) { | ||
| ^^^^^^^^^^^^^^^^^^ | ||
= help: to disambiguate the method call, write `async::r#struct(r#fn {})` instead | ||
note: candidate #2 is defined in an impl of the trait `await` for the type `r#fn` | ||
--> $DIR/issue-65634-raw-ident-suggestion.rs:10:5 | ||
| | ||
LL | fn r#struct(&self) { | ||
| ^^^^^^^^^^^^^^^^^^ | ||
= help: to disambiguate the method call, write `await::r#struct(r#fn {})` instead | ||
|
||
error: aborting due to previous error | ||
|
||
For more information about this error, try `rustc --explain E0034`. |
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
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