mirror of
https://github.com/rust-lang/rust.git
synced 2025-01-25 14:13:38 +00:00
Merge #10389
10389: fix: use the right `HirFileId` when expanding macros in fn parameters r=Veykril a=SkiFire13 Fixes #10388 Co-authored-by: Giacomo Stevanato <giaco.stevanato@gmail.com>
This commit is contained in:
commit
b21f15a237
@ -299,7 +299,7 @@ impl GenericParams {
|
||||
let macro_call = mc.to_node(db.upcast());
|
||||
match expander.enter_expand::<ast::Type>(db, macro_call) {
|
||||
Ok(ExpandResult { value: Some((mark, expanded)), .. }) => {
|
||||
let ctx = LowerCtx::new(db, mc.file_id);
|
||||
let ctx = LowerCtx::new(db, expander.current_file_id());
|
||||
let type_ref = TypeRef::from_ast(&ctx, expanded);
|
||||
self.fill_implicit_impl_trait_args(db, expander, &type_ref);
|
||||
expander.exit(db, mark);
|
||||
|
@ -1198,3 +1198,26 @@ fn bar() {
|
||||
"#,
|
||||
)
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn nested_macro_in_fn_params() {
|
||||
check_no_mismatches(
|
||||
r#"
|
||||
macro_rules! U32Inner {
|
||||
() => {
|
||||
u32
|
||||
};
|
||||
}
|
||||
|
||||
macro_rules! U32 {
|
||||
() => {
|
||||
U32Inner!()
|
||||
};
|
||||
}
|
||||
|
||||
fn mamba(a: U32!(), p: u32) -> u32 {
|
||||
a
|
||||
}
|
||||
"#,
|
||||
)
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user