Skip to content

Commit dbf4910

Browse files
committed
Update stderr
The spans generated by `quote!` are (intentionally) no longer all the same, so I removed that check entirely.
1 parent f916b04 commit dbf4910

File tree

3 files changed

+9
-24
lines changed

3 files changed

+9
-24
lines changed

src/test/ui/hygiene/unpretty-debug.stdout

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ fn y /* 0#0 */() { }
2020
/*
2121
Expansions:
2222
0: parent: ExpnId(0), call_site_ctxt: #0, def_site_ctxt: #0, kind: Root
23-
1: parent: ExpnId(0), call_site_ctxt: #0, def_site_ctxt: #0, kind: Macro(Bang, "foo")
23+
1: parent: ExpnId(0), call_site_ctxt: #0, def_site_ctxt: #0, kind: Macro { kind: Bang, name: "foo", proc_macro: false }
2424

2525
SyntaxContexts:
2626
#0: parent: #0, outer_mark: (ExpnId(0), Opaque)

src/test/ui/macros/auxiliary/proc_macro_sequence.rs

-19
Original file line numberDiff line numberDiff line change
@@ -23,24 +23,5 @@ pub fn make_foo(_: TokenStream) -> TokenStream {
2323
}
2424
};
2525

26-
// Check that all spans are equal.
27-
// FIXME: `quote!` gives def-site spans to idents and literals,
28-
// but leaves (default) call-site spans on groups and punctuation.
29-
let mut span_call = None;
30-
let mut span_def = None;
31-
for tt in result.clone() {
32-
match tt {
33-
TokenTree::Ident(..) | TokenTree::Literal(..) => match span_def {
34-
None => span_def = Some(tt.span()),
35-
Some(span) => assert_same_span(tt.span(), span),
36-
}
37-
TokenTree::Punct(..) | TokenTree::Group(..) => match span_call {
38-
None => span_call = Some(tt.span()),
39-
Some(span) => assert_same_span(tt.span(), span),
40-
}
41-
}
42-
43-
}
44-
4526
result
4627
}

src/test/ui/macros/same-sequence-span.stderr

+8-4
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,15 @@ LL | $(= $z:tt)*
1717
error: `$x:expr` may be followed by `$y:tt`, which is not allowed for `expr` fragments
1818
--> $DIR/same-sequence-span.rs:19:1
1919
|
20-
LL | proc_macro_sequence::make_foo!();
21-
| ---------------------------------^^^^^^^^^^^^^
20+
LL | proc_macro_sequence::make_foo!();
21+
| ^--------------------------------
22+
| |
23+
| _in this macro invocation
2224
| |
23-
| not allowed after `expr` fragments
24-
| in this macro invocation
25+
LL | |
26+
LL | |
27+
LL | | fn main() {}
28+
| |_________________________________^ not allowed after `expr` fragments
2529
|
2630
= note: allowed there are: `=>`, `,` or `;`
2731
= note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info)

0 commit comments

Comments
 (0)