@@ -159,7 +159,7 @@ impl<'a> std::fmt::Debug for CrateDump<'a> {
159
159
}
160
160
}
161
161
162
- ///
162
+ /// Reason that a crate is being sourced as a dependency.
163
163
#[ derive( Clone , Copy ) ]
164
164
enum CrateOrigin < ' a > {
165
165
/// This crate was a dependency of another crate.
@@ -168,15 +168,14 @@ enum CrateOrigin<'a> {
168
168
/// Dependency info about this crate.
169
169
dep : & ' a CrateDep ,
170
170
} ,
171
- ///
171
+ /// Injected
172
172
Injected ,
173
173
/// An extern that has been provided with the `force` option.
174
174
ForcedExtern ,
175
- ///
175
+ /// Part of the extern prelude.
176
176
ExternPrelude ,
177
- /// Provided by `extern crate foo` or `extern crate foo as bar`.
178
- #[ allow( unused) ]
179
- AstExtern { name : Symbol , orig_name : Option < Symbol > } ,
177
+ /// Provided by `extern crate foo`.
178
+ AstExtern ,
180
179
}
181
180
182
181
impl < ' a > CrateOrigin < ' a > {
@@ -458,15 +457,6 @@ impl<'a, 'tcx> CrateLoader<'a, 'tcx> {
458
457
return true ;
459
458
}
460
459
461
- // if name == sym::compiler_builtins {
462
- // // compiler_builtins is an implementation detail and should never show up in
463
- // // diagnostics. `dep_root` is `None` if the requested crate came from an `extern
464
- // // crate ..`, which is the case since `compiler_builtins` is injected into AST at
465
- // // `rustc_builtin_macros::standard_library_imports::inject`.
466
- // //
467
- // // See also the note at that module referencing #113634.
468
- // return true;
469
- // }
470
460
// Any descendants of `std` should be private. These crates are usually not marked
471
461
// private in metadata, so we ignore that field.
472
462
if extern_private. is_none ( )
@@ -1052,49 +1042,18 @@ impl<'a, 'tcx> CrateLoader<'a, 'tcx> {
1052
1042
return ;
1053
1043
}
1054
1044
1055
- // let Some((cnum, _meta)) = self
1056
- // .cstore
1057
- // .iter_crate_data()
1058
- // .find(|(_cnum, meta)| meta.name() == sym::compiler_builtins)
1059
- // else {
1060
- // info!("`compiler_builtins` crate was not found for");
1061
- // return;
1062
- // };
1063
- //
1064
- info ! ( "looking for builtins in {}" , self . cstore. crate_name( LOCAL_CRATE ) ) ;
1065
-
1066
- // self.process_extern_crate(
1067
- // ast::ItemKind::ExternCrate(Some(sym::compiler_builtins)),
1068
- // def_id,
1069
- // definitions,
1070
- // )
1071
1045
1072
1046
let res = self . maybe_resolve_crate (
1073
1047
sym:: compiler_builtins,
1074
- CrateDepKind :: Explicit ,
1048
+ CrateDepKind :: Implicit ,
1075
1049
CrateOrigin :: Injected ,
1076
1050
) ;
1077
1051
1078
- info ! ( "BUILTINS RESULT: {res:?}" ) ;
1079
-
1080
- // let cnum = self
1081
- // .resolve_crate(
1082
- // sym::compiler_builtins,
1083
- // DUMMY_SP,
1084
- // CrateDepKind::Explicit,
1085
- // CrateOrigin::Injected,
1086
- // )
1087
- // .expect("unresolved builtins");
1088
-
1089
- // self.cstore.update_extern_crate(cnum, ExternCrate {
1090
- // src: ExternCrateSource::Path,
1091
- // // src: ExternCrateSource::Extern(def_id.to_def_id()),
1092
- // span: DUMMY_SP,
1093
- // path_len: "compiler_builtins".len(),
1094
- // dependency_of: LOCAL_CRATE,
1095
- // });
1096
-
1097
- // self.cstore.get_crate_data_mut(LOCAL_CRATE).add_dependency(cnum);
1052
+ if res. is_ok ( ) {
1053
+ info ! ( "`compiler_builtins` found" ) ;
1054
+ } else {
1055
+ info ! ( "`compiler_builtins` not found, skipping" ) ;
1056
+ }
1098
1057
}
1099
1058
1100
1059
fn inject_dependency_if (
0 commit comments