@@ -1529,6 +1529,9 @@ pub struct Resolver<'a> {
1529
1529
current_type_ascription : Vec < Span > ,
1530
1530
1531
1531
injected_crate : Option < Module < ' a > > ,
1532
+
1533
+ /// Only supposed to be used by rustdoc, otherwise should be false.
1534
+ pub ignore_extern_prelude_feature : bool ,
1532
1535
}
1533
1536
1534
1537
/// Nothing really interesting here, it just provides memory for the rest of the crate.
@@ -1792,6 +1795,7 @@ impl<'a> Resolver<'a> {
1792
1795
unused_macros : FxHashSet ( ) ,
1793
1796
current_type_ascription : Vec :: new ( ) ,
1794
1797
injected_crate : None ,
1798
+ ignore_extern_prelude_feature : false ,
1795
1799
}
1796
1800
}
1797
1801
@@ -1972,7 +1976,8 @@ impl<'a> Resolver<'a> {
1972
1976
if !module. no_implicit_prelude {
1973
1977
// `record_used` means that we don't try to load crates during speculative resolution
1974
1978
if record_used && ns == TypeNS && self . extern_prelude . contains ( & ident. name ) {
1975
- if !self . session . features_untracked ( ) . extern_prelude {
1979
+ if !self . session . features_untracked ( ) . extern_prelude &&
1980
+ !self . ignore_extern_prelude_feature {
1976
1981
feature_err ( & self . session . parse_sess , "extern_prelude" ,
1977
1982
ident. span , GateIssue :: Language ,
1978
1983
"access to extern crates through prelude is experimental" ) . emit ( ) ;
0 commit comments