diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-05-30 03:57:19 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-05-30 03:57:19 +0000 |
commit | a0b8f38ab54ac451646aa00cd5e91b6c76f22a84 (patch) | |
tree | fc451898ccaf445814e26b46664d78702178101d /compiler/rustc_ast/src/expand | |
parent | Adding debian version 1.71.1+dfsg1-2. (diff) | |
download | rustc-a0b8f38ab54ac451646aa00cd5e91b6c76f22a84.tar.xz rustc-a0b8f38ab54ac451646aa00cd5e91b6c76f22a84.zip |
Merging upstream version 1.72.1+dfsg1.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'compiler/rustc_ast/src/expand')
-rw-r--r-- | compiler/rustc_ast/src/expand/mod.rs | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/compiler/rustc_ast/src/expand/mod.rs b/compiler/rustc_ast/src/expand/mod.rs index 2ee1bfe0a..942347383 100644 --- a/compiler/rustc_ast/src/expand/mod.rs +++ b/compiler/rustc_ast/src/expand/mod.rs @@ -1,3 +1,20 @@ //! Definitions shared by macros / syntax extensions and e.g. `rustc_middle`. +use rustc_span::{def_id::DefId, symbol::Ident}; + +use crate::MetaItem; + pub mod allocator; + +#[derive(Debug, Clone, Encodable, Decodable, HashStable_Generic)] +pub struct StrippedCfgItem<ModId = DefId> { + pub parent_module: ModId, + pub name: Ident, + pub cfg: MetaItem, +} + +impl<ModId> StrippedCfgItem<ModId> { + pub fn map_mod_id<New>(self, f: impl FnOnce(ModId) -> New) -> StrippedCfgItem<New> { + StrippedCfgItem { parent_module: f(self.parent_module), name: self.name, cfg: self.cfg } + } +} |