File tree Expand file tree Collapse file tree 3 files changed +21
-4
lines changed
compiler/rustc_metadata/src
tests/run-make/issue-83045 Expand file tree Collapse file tree 3 files changed +21
-4
lines changed Original file line number Diff line number Diff line change @@ -148,11 +148,15 @@ impl CStore {
148148 assert_eq ! ( self . metas. len( ) , self . stable_crate_ids. len( ) ) ;
149149 let num = CrateNum :: new ( self . stable_crate_ids . len ( ) ) ;
150150 if let Some ( & existing) = self . stable_crate_ids . get ( & root. stable_crate_id ( ) ) {
151- let crate_name0 = root. name ( ) ;
152- if let Some ( crate_name1) = self . metas [ existing] . as_ref ( ) . map ( |data| data. name ( ) ) {
151+ // Check for (potential) conflicts with the local crate
152+ if existing == LOCAL_CRATE {
153+ Err ( CrateError :: SymbolConflictsCurrent ( root. name ( ) ) )
154+ } else if let Some ( crate_name1) = self . metas [ existing] . as_ref ( ) . map ( |data| data. name ( ) )
155+ {
156+ let crate_name0 = root. name ( ) ;
153157 Err ( CrateError :: StableCrateIdCollision ( crate_name0, crate_name1) )
154158 } else {
155- Err ( CrateError :: SymbolConflictsCurrent ( crate_name0 ) )
159+ Err ( CrateError :: NotFound ( root . name ( ) ) )
156160 }
157161 } else {
158162 self . metas . push ( None ) ;
Original file line number Diff line number Diff line change @@ -961,6 +961,7 @@ pub(crate) enum CrateError {
961961 DlSym ( String ) ,
962962 LocatorCombined ( Box < CombinedLocatorError > ) ,
963963 NonDylibPlugin ( Symbol ) ,
964+ NotFound ( Symbol ) ,
964965}
965966
966967enum MetadataError < ' a > {
@@ -1131,6 +1132,18 @@ impl CrateError {
11311132 CrateError :: NonDylibPlugin ( crate_name) => {
11321133 sess. emit_err ( errors:: NoDylibPlugin { span, crate_name } ) ;
11331134 }
1135+ CrateError :: NotFound ( crate_name) => {
1136+ sess. emit_err ( errors:: CannotFindCrate {
1137+ span,
1138+ crate_name,
1139+ add_info : String :: new ( ) ,
1140+ missing_core,
1141+ current_crate : sess. opts . crate_name . clone ( ) . unwrap_or ( "<unknown>" . to_string ( ) ) ,
1142+ is_nightly_build : sess. is_nightly_build ( ) ,
1143+ profiler_runtime : Symbol :: intern ( & sess. opts . unstable_opts . profiler_runtime ) ,
1144+ locator_triple : sess. opts . target_triple . clone ( ) ,
1145+ } ) ;
1146+ }
11341147 }
11351148 }
11361149}
Original file line number Diff line number Diff line change 2929 --crate-type=rlib \
3030 --edition=2018 \
3131 c.rs 2>&1 | tee $(TMPDIR ) /output.txt || exit 0
32- $(CGREP ) E0519 < $(TMPDIR ) /output.txt
32+ $(CGREP ) E0463 < $(TMPDIR ) /output.txt
3333 $(CGREP ) -v " internal compiler error" < $(TMPDIR ) /output.txt
You can’t perform that action at this time.
0 commit comments