File tree Expand file tree Collapse file tree 3 files changed +26
-3
lines changed
compiler/rustc_resolve/src Expand file tree Collapse file tree 3 files changed +26
-3
lines changed Original file line number Diff line number Diff line change @@ -2441,10 +2441,9 @@ fn show_candidates(
24412441
24422442 for candidate in accessible_path_strings {
24432443 msg. push ( '\n' ) ;
2444- msg. push_str ( & candidate. 0 ) ;
2444+ msg. push_str ( & format ! ( "use {};" , & candidate. 0 ) ) ;
24452445 }
2446-
2447- err. note ( & msg) ;
2446+ err. help ( & msg) ;
24482447 }
24492448 } else if !matches ! ( mode, DiagnosticMode :: Import ) {
24502449 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