add raw identifier for keyword in suggestion
This commit is contained in:
parent
79335f1ac4
commit
97ae79ac9d
@ -393,7 +393,7 @@ fn try_print_trimmed_def_path(
|
||||
match self.tcx().trimmed_def_paths(()).get(&def_id) {
|
||||
None => Ok((self, false)),
|
||||
Some(symbol) => {
|
||||
self.write_str(symbol.as_str())?;
|
||||
write!(self, "{}", Ident::with_dummy_span(*symbol))?;
|
||||
Ok((self, true))
|
||||
}
|
||||
}
|
||||
|
@ -1,16 +1,16 @@
|
||||
error[E0034]: multiple applicable items in scope
|
||||
--> $DIR/issue-65634-raw-ident-suggestion.rs:21:13
|
||||
--> $DIR/issue-65634-raw-ident-suggestion.rs:24: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 `fn`
|
||||
--> $DIR/issue-65634-raw-ident-suggestion.rs:4:5
|
||||
note: candidate #1 is defined in an impl of the trait `async` for the type `r#fn`
|
||||
--> $DIR/issue-65634-raw-ident-suggestion.rs:7:5
|
||||
|
|
||||
LL | fn r#struct(&self) {
|
||||
| ^^^^^^^^^^^^^^^^^^
|
||||
note: candidate #2 is defined in an impl of the trait `await` for the type `fn`
|
||||
--> $DIR/issue-65634-raw-ident-suggestion.rs:10:5
|
||||
note: candidate #2 is defined in an impl of the trait `await` for the type `r#fn`
|
||||
--> $DIR/issue-65634-raw-ident-suggestion.rs:13:5
|
||||
|
|
||||
LL | fn r#struct(&self) {
|
||||
| ^^^^^^^^^^^^^^^^^^
|
@ -0,0 +1,28 @@
|
||||
error[E0034]: multiple applicable items in scope
|
||||
--> $DIR/issue-65634-raw-ident-suggestion.rs:24:13
|
||||
|
|
||||
LL | r#fn {}.r#struct();
|
||||
| ^^^^^^^^ multiple `r#struct` found
|
||||
|
|
||||
note: candidate #1 is defined in an impl of the trait `r#async` for the type `r#fn`
|
||||
--> $DIR/issue-65634-raw-ident-suggestion.rs:7:5
|
||||
|
|
||||
LL | fn r#struct(&self) {
|
||||
| ^^^^^^^^^^^^^^^^^^
|
||||
note: candidate #2 is defined in an impl of the trait `r#await` for the type `r#fn`
|
||||
--> $DIR/issue-65634-raw-ident-suggestion.rs:13:5
|
||||
|
|
||||
LL | fn r#struct(&self) {
|
||||
| ^^^^^^^^^^^^^^^^^^
|
||||
help: disambiguate the associated function for candidate #1
|
||||
|
|
||||
LL | r#async::r#struct(&r#fn {});
|
||||
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
help: disambiguate the associated function for candidate #2
|
||||
|
|
||||
LL | r#await::r#struct(&r#fn {});
|
||||
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
error: aborting due to previous error
|
||||
|
||||
For more information about this error, try `rustc --explain E0034`.
|
@ -1,3 +1,6 @@
|
||||
// revisions: edition2015 edition2018
|
||||
//[edition2018]edition:2018
|
||||
|
||||
#![allow(non_camel_case_types)]
|
||||
|
||||
trait r#async {
|
||||
|
Loading…
Reference in New Issue
Block a user