File tree 3 files changed +26
-3
lines changed
compiler/rustc_resolve/src
3 files changed +26
-3
lines changed Original file line number Diff line number Diff line change @@ -2441,10 +2441,9 @@ fn show_candidates(
2441
2441
2442
2442
for candidate in accessible_path_strings {
2443
2443
msg. push ( '\n' ) ;
2444
- msg. push_str ( & candidate. 0 ) ;
2444
+ msg. push_str ( & format ! ( "use {};" , & candidate. 0 ) ) ;
2445
2445
}
2446
-
2447
- err. note ( & msg) ;
2446
+ err. help ( & msg) ;
2448
2447
}
2449
2448
} else if !matches ! ( mode, DiagnosticMode :: Import ) {
2450
2449
assert ! ( !inaccessible_path_strings. is_empty( ) ) ;
Original file line number Diff line number Diff line change
1
+ mod hey {
2
+ pub use std:: println as bitflags;
3
+ }
4
+
5
+ fn main ( ) {
6
+ bitflags ! { //~ ERROR cannot find macro `bitflags` in this scope
7
+ struct Flags : u32 {
8
+ const A = 0b00000001 ;
9
+ }
10
+ }
11
+ }
12
+ //~ HELP consider importing this macro:
13
+ // use hey::bitflags;
Original file line number Diff line number Diff line change
1
+ error: cannot find macro `bitflags` in this scope
2
+ --> $DIR/issue-102601.rs:6:5
3
+ |
4
+ LL | bitflags! {
5
+ | ^^^^^^^^
6
+ |
7
+ = help: consider importing this macro:
8
+ use hey::bitflags;
9
+
10
+ error: aborting due to previous error
11
+
You can’t perform that action at this time.
0 commit comments