Unnamed repository; edit this file 'description' to name the repository.
Diffstat (limited to 'crates/hir-def/src/nameres.rs')
| -rw-r--r-- | crates/hir-def/src/nameres.rs | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/crates/hir-def/src/nameres.rs b/crates/hir-def/src/nameres.rs index 8aceb4952a..ccb9bed5c5 100644 --- a/crates/hir-def/src/nameres.rs +++ b/crates/hir-def/src/nameres.rs @@ -127,6 +127,8 @@ pub struct DefMap { unstable_features: FxHashSet<SmolStr>, /// #[rustc_coherence_is_core] rustc_coherence_is_core: bool, + no_core: bool, + no_std: bool, edition: Edition, recursion_limit: Option<u32>, @@ -294,6 +296,8 @@ impl DefMap { unstable_features: FxHashSet::default(), diagnostics: Vec::new(), rustc_coherence_is_core: false, + no_core: false, + no_std: false, } } @@ -331,6 +335,10 @@ impl DefMap { self.rustc_coherence_is_core } + pub fn is_no_std(&self) -> bool { + self.no_std || self.no_core + } + pub fn root(&self) -> LocalModuleId { self.root } @@ -528,6 +536,8 @@ impl DefMap { prelude: _, root: _, rustc_coherence_is_core: _, + no_core: _, + no_std: _, } = self; extern_prelude.shrink_to_fit(); |