@@ -1437,6 +1437,9 @@ pub struct Resolver<'a> {
1437
1437
current_type_ascription : Vec < Span > ,
1438
1438
1439
1439
injected_crate : Option < Module < ' a > > ,
1440
+
1441
+ /// Only supposed to be used by rustdoc, otherwise should be false.
1442
+ pub ignore_extern_prelude_feature : bool ,
1440
1443
}
1441
1444
1442
1445
/// Nothing really interesting here, it just provides memory for the rest of the crate.
@@ -1718,6 +1721,7 @@ impl<'a> Resolver<'a> {
1718
1721
unused_macros : FxHashSet ( ) ,
1719
1722
current_type_ascription : Vec :: new ( ) ,
1720
1723
injected_crate : None ,
1724
+ ignore_extern_prelude_feature : false ,
1721
1725
}
1722
1726
}
1723
1727
@@ -1891,7 +1895,8 @@ impl<'a> Resolver<'a> {
1891
1895
if !module. no_implicit_prelude {
1892
1896
// `record_used` means that we don't try to load crates during speculative resolution
1893
1897
if record_used && ns == TypeNS && self . extern_prelude . contains ( & ident. name ) {
1894
- if !self . session . features_untracked ( ) . extern_prelude {
1898
+ if !self . session . features_untracked ( ) . extern_prelude &&
1899
+ !self . ignore_extern_prelude_feature {
1895
1900
feature_err ( & self . session . parse_sess , "extern_prelude" ,
1896
1901
ident. span , GateIssue :: Language ,
1897
1902
"access to extern crates through prelude is experimental" ) . emit ( ) ;
0 commit comments