mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-25 16:24:46 +00:00
Name the field in Expander
.
For code clarity.
This commit is contained in:
parent
1b3fba066c
commit
11e95d43ae
@ -10,7 +10,9 @@ use rustc_session::Session;
|
|||||||
use rustc_span::symbol::{sym, Ident};
|
use rustc_span::symbol::{sym, Ident};
|
||||||
use rustc_span::{ErrorGuaranteed, Span};
|
use rustc_span::{ErrorGuaranteed, Span};
|
||||||
|
|
||||||
pub(crate) struct Expander(pub bool);
|
pub(crate) struct Expander {
|
||||||
|
pub is_const: bool,
|
||||||
|
}
|
||||||
|
|
||||||
impl MultiItemModifier for Expander {
|
impl MultiItemModifier for Expander {
|
||||||
fn expand(
|
fn expand(
|
||||||
@ -58,7 +60,7 @@ impl MultiItemModifier for Expander {
|
|||||||
report_path_args(sess, meta);
|
report_path_args(sess, meta);
|
||||||
meta.path.clone()
|
meta.path.clone()
|
||||||
})
|
})
|
||||||
.map(|path| (path, dummy_annotatable(), None, self.0))
|
.map(|path| (path, dummy_annotatable(), None, self.is_const))
|
||||||
.collect()
|
.collect()
|
||||||
}
|
}
|
||||||
_ => vec![],
|
_ => vec![],
|
||||||
|
@ -109,8 +109,8 @@ pub fn register_builtin_macros(resolver: &mut dyn ResolverExpand) {
|
|||||||
bench: test::expand_bench,
|
bench: test::expand_bench,
|
||||||
cfg_accessible: cfg_accessible::Expander,
|
cfg_accessible: cfg_accessible::Expander,
|
||||||
cfg_eval: cfg_eval::expand,
|
cfg_eval: cfg_eval::expand,
|
||||||
derive: derive::Expander(false),
|
derive: derive::Expander { is_const: false },
|
||||||
derive_const: derive::Expander(true),
|
derive_const: derive::Expander { is_const: true },
|
||||||
global_allocator: global_allocator::expand,
|
global_allocator: global_allocator::expand,
|
||||||
test: test::expand_test,
|
test: test::expand_test,
|
||||||
test_case: test::expand_test_case,
|
test_case: test::expand_test_case,
|
||||||
|
Loading…
Reference in New Issue
Block a user