@@ -219,7 +219,7 @@ use rustc_data_structures::fx::{FxHashMap, FxHashSet};
219
219
use rustc_data_structures:: owning_ref:: OwningRef ;
220
220
use rustc_data_structures:: svh:: Svh ;
221
221
use rustc_data_structures:: sync:: MetadataRef ;
222
- use rustc_errors:: struct_span_err;
222
+ use rustc_errors:: { struct_span_err, Applicability } ;
223
223
use rustc_middle:: middle:: cstore:: { CrateSource , MetadataLoader } ;
224
224
use rustc_session:: config:: { self , CrateType } ;
225
225
use rustc_session:: filesearch:: { FileDoesntMatch , FileMatches , FileSearch } ;
@@ -1068,6 +1068,14 @@ impl CrateError {
1068
1068
err. note ( & format ! ( "the `{}` target may not be installed" , locator. triple) ) ;
1069
1069
} else if crate_name == sym:: profiler_builtins {
1070
1070
err. note ( & "the compiler may have been built without the profiler runtime" ) ;
1071
+ } else if crate_name == sym:: meta {
1072
+ err. note ( & "meta is a reserved crate name" ) ;
1073
+ err. span_suggestion (
1074
+ span,
1075
+ "you can use `crate::` or `self::` if you intended to refer to a local module and not a crate" ,
1076
+ "crate::meta" . to_string ( ) ,
1077
+ Applicability :: MaybeIncorrect ,
1078
+ ) ;
1071
1079
}
1072
1080
err. span_label ( span, "can't find crate" ) ;
1073
1081
err
0 commit comments