diff options
| author | lcnr <rust@lcnr.de> | 2022-03-15 16:30:30 +0100 |
|---|---|---|
| committer | lcnr <rust@lcnr.de> | 2022-03-30 11:23:58 +0200 |
| commit | bef6f3e895beede5bfd5ba4bb12898615c156d59 (patch) | |
| tree | 724e0593725707bbff014409e6b495142830315b /compiler/rustc_middle/src/hir/map | |
| parent | 4558a125b6108f3c080e88d7746e1d422b969bef (diff) | |
| download | rust-bef6f3e895beede5bfd5ba4bb12898615c156d59.tar.gz rust-bef6f3e895beede5bfd5ba4bb12898615c156d59.zip | |
rework implementation for inherent impls for builtin types
Diffstat (limited to 'compiler/rustc_middle/src/hir/map')
| -rw-r--r-- | compiler/rustc_middle/src/hir/map/mod.rs | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/compiler/rustc_middle/src/hir/map/mod.rs b/compiler/rustc_middle/src/hir/map/mod.rs index ec20e888333..8afa6e70e41 100644 --- a/compiler/rustc_middle/src/hir/map/mod.rs +++ b/compiler/rustc_middle/src/hir/map/mod.rs @@ -579,6 +579,10 @@ impl<'hir> Map<'hir> { self.attrs(CRATE_HIR_ID) } + pub fn rustc_coherence_is_core(self) -> bool { + self.krate_attrs().iter().any(|attr| attr.has_name(sym::rustc_coherence_is_core)) + } + pub fn get_module(self, module: LocalDefId) -> (&'hir Mod<'hir>, Span, HirId) { let hir_id = HirId::make_owner(module); match self.tcx.hir_owner(module).map(|o| o.node) { |
