Skip to content

Commit f2e3031

Browse files
petrochenkovpietroalbini
authored andcommitted
expand: Do not do questionable span adjustment before eagerly expanding an expression
Maybe it made sense when it was introduced, but now it's doing something incorrect.
1 parent 3d95d17 commit f2e3031

File tree

3 files changed

+3
-15
lines changed

3 files changed

+3
-15
lines changed

src/libsyntax/ext/base.rs

-3
Original file line numberDiff line numberDiff line change
@@ -944,9 +944,6 @@ pub fn expr_to_spanned_string<'a>(
944944
mut expr: P<ast::Expr>,
945945
err_msg: &str,
946946
) -> Result<Spanned<(Symbol, ast::StrStyle)>, Option<DiagnosticBuilder<'a>>> {
947-
// Update `expr.span`'s ctxt now in case expr is an `include!` macro invocation.
948-
expr.span = expr.span.apply_mark(cx.current_expansion.id);
949-
950947
// we want to be able to handle e.g., `concat!("foo", "bar")`
951948
cx.expander().visit_expr(&mut expr);
952949
Err(match expr.node {

src/test/ui/hygiene/eager-from-opaque.rs

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
// Opaque macro can eagerly expand its input without breaking its resolution.
22
// Regression test for issue #63685.
33

4+
// check-pass
5+
46
macro_rules! foo {
57
() => {
68
"foo"
@@ -9,7 +11,7 @@ macro_rules! foo {
911

1012
macro_rules! bar {
1113
() => {
12-
foo!() //~ ERROR cannot find macro `foo!` in this scope
14+
foo!()
1315
};
1416
}
1517

src/test/ui/hygiene/eager-from-opaque.stderr

-11
This file was deleted.

0 commit comments

Comments
 (0)