Input::Str { .. } => "rust_out".to_string(),
}
}
+
+ pub fn get_input(&mut self) -> Option<&mut String> {
+ match *self {
+ Input::File(_) => None,
+ Input::Str { ref mut input, .. } => Some(input),
+ }
+ }
}
#[derive(Clone)]
current_type_ascription: Vec<Span>,
injected_crate: Option<Module<'a>>,
+
+ /// Only supposed to be used by rustdoc, otherwise should be false.
+ pub ignore_extern_prelude_feature: bool,
}
/// Nothing really interesting here, it just provides memory for the rest of the crate.
unused_macros: FxHashSet(),
current_type_ascription: Vec::new(),
injected_crate: None,
+ ignore_extern_prelude_feature: false,
}
}
if !module.no_implicit_prelude {
// `record_used` means that we don't try to load crates during speculative resolution
if record_used && ns == TypeNS && self.extern_prelude.contains(&ident.name) {
- if !self.session.features_untracked().extern_prelude {
+ if !self.session.features_untracked().extern_prelude &&
+ !self.ignore_extern_prelude_feature {
feature_err(&self.session.parse_sess, "extern_prelude",
ident.span, GateIssue::Language,
"access to extern crates through prelude is experimental").emit();
// early return and try looking for the trait
let value = match result.def {
Def::Method(_) | Def::AssociatedConst(_) => true,
- Def::AssociatedTy(_) => false,
+ Def::AssociatedTy(_) => false,
Def::Variant(_) => return handle_variant(cx, result.def),
// not a trait item, just return what we found
_ => return Ok((result.def, None))
|_| Ok(()));
let driver::InnerExpansionResult {
mut hir_forest,
- resolver,
+ mut resolver,
..
} = abort_on_err(result, &sess);
+ resolver.ignore_extern_prelude_feature = true;
+
// We need to hold on to the complete resolver, so we clone everything
// for the analysis passes to use. Suboptimal, but necessary in the
// current architecture.