Skip to content

Commit ee857f7

Browse files
committed
try to resolve under eager expander
1 parent 43fdd49 commit ee857f7

File tree

3 files changed

+24
-3
lines changed

3 files changed

+24
-3
lines changed

compiler/rustc_builtin_macros/src/format.rs

+1
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ use PositionUsedAs::*;
3939

4040
use crate::errors;
4141

42+
#[derive(Debug)]
4243
struct MacroInput {
4344
fmtstr: P<Expr>,
4445
args: FormatArguments,

compiler/rustc_expand/src/expand.rs

+1-3
Original file line numberDiff line numberDiff line change
@@ -549,9 +549,7 @@ impl<'a, 'b> MacroExpander<'a, 'b> {
549549
}
550550

551551
fn resolve_imports(&mut self) {
552-
if self.monotonic {
553-
self.cx.resolver.resolve_imports();
554-
}
552+
self.cx.resolver.resolve_imports();
555553
}
556554

557555
/// Collects all macro invocations reachable at this time in this AST fragment, and replace
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
//@check-pass
2+
//@edition: 2018
3+
4+
// https://github.com/rust-lang/rust/issues/98291
5+
6+
macro_rules! wrap {
7+
() => {
8+
macro_rules! _a {
9+
() => {
10+
"Hello world"
11+
};
12+
}
13+
};
14+
}
15+
16+
wrap!();
17+
18+
use _a as a;
19+
20+
fn main() {
21+
format_args!(a!());
22+
}

0 commit comments

Comments
 (0)