File tree Expand file tree Collapse file tree 5 files changed +44
-7
lines changed Expand file tree Collapse file tree 5 files changed +44
-7
lines changed Original file line number Diff line number Diff line change @@ -4046,13 +4046,27 @@ impl<'a> Resolver<'a> {
40464046 } else {
40474047 // Items from the prelude
40484048 if !module. no_implicit_prelude {
4049- names. extend ( self . extern_prelude . iter ( ) . map ( |( ident, _) | {
4050- TypoSuggestion {
4051- candidate : ident. name ,
4052- article : "a" ,
4053- kind : "crate" ,
4054- }
4049+ names. extend ( self . extern_prelude . clone ( ) . iter ( ) . flat_map ( |( ident, _) | {
4050+ self . crate_loader
4051+ . maybe_process_path_extern ( ident. name , ident. span )
4052+ . and_then ( |crate_id| {
4053+ let crate_mod = Def :: Mod ( DefId {
4054+ krate : crate_id,
4055+ index : CRATE_DEF_INDEX ,
4056+ } ) ;
4057+
4058+ if filter_fn ( crate_mod) {
4059+ Some ( TypoSuggestion {
4060+ candidate : ident. name ,
4061+ article : "a" ,
4062+ kind : "crate" ,
4063+ } )
4064+ } else {
4065+ None
4066+ }
4067+ } )
40554068 } ) ) ;
4069+
40564070 if let Some ( prelude) = self . prelude {
40574071 add_module_candidates ( prelude, & mut names) ;
40584072 }
Original file line number Diff line number Diff line change @@ -20,7 +20,7 @@ error: cannot find derive macro `attr_proc_macra` in this scope
2020 --> $DIR/resolve-error.rs:44:10
2121 |
2222LL | #[derive(attr_proc_macra)]
23- | ^^^^^^^^^^^^^^^ help: try: `attr_proc_macro`
23+ | ^^^^^^^^^^^^^^^
2424
2525error: cannot find macro `FooWithLongNama!` in this scope
2626 --> $DIR/resolve-error.rs:49:5
Original file line number Diff line number Diff line change 1+ //! Contains a struct with almost the same name as itself, to trigger Levenshtein suggestions.
2+
3+ pub struct Foo ;
Original file line number Diff line number Diff line change 1+ // aux-build:foo.rs
2+
3+ extern crate foo;
4+
5+ type Output = Option < Foo > ; //~ ERROR cannot find type `Foo`
6+
7+ fn main ( ) { }
Original file line number Diff line number Diff line change 1+ error[E0412]: cannot find type `Foo` in this scope
2+ --> $DIR/no-extern-crate-in-type.rs:5:22
3+ |
4+ LL | type Output = Option<Foo>;
5+ | ^^^ not found in this scope
6+ help: possible candidate is found in another module, you can import it into scope
7+ |
8+ LL | use foo::Foo;
9+ |
10+
11+ error: aborting due to previous error
12+
13+ For more information about this error, try `rustc --explain E0412`.
You can’t perform that action at this time.
0 commit comments