Skip to content

Commit

Permalink
Update stderr
Browse files Browse the repository at this point in the history
The spans generated by `quote!` are (intentionally) no longer all the
same, so I removed that check entirely.
  • Loading branch information
Aaron1011 committed May 12, 2021
1 parent f916b04 commit dbf4910
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 24 deletions.
2 changes: 1 addition & 1 deletion src/test/ui/hygiene/unpretty-debug.stdout
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ fn y /* 0#0 */() { }
/*
Expansions:
0: parent: ExpnId(0), call_site_ctxt: #0, def_site_ctxt: #0, kind: Root
1: parent: ExpnId(0), call_site_ctxt: #0, def_site_ctxt: #0, kind: Macro(Bang, "foo")
1: parent: ExpnId(0), call_site_ctxt: #0, def_site_ctxt: #0, kind: Macro { kind: Bang, name: "foo", proc_macro: false }

SyntaxContexts:
#0: parent: #0, outer_mark: (ExpnId(0), Opaque)
Expand Down
19 changes: 0 additions & 19 deletions src/test/ui/macros/auxiliary/proc_macro_sequence.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,24 +23,5 @@ pub fn make_foo(_: TokenStream) -> TokenStream {
}
};

// Check that all spans are equal.
// FIXME: `quote!` gives def-site spans to idents and literals,
// but leaves (default) call-site spans on groups and punctuation.
let mut span_call = None;
let mut span_def = None;
for tt in result.clone() {
match tt {
TokenTree::Ident(..) | TokenTree::Literal(..) => match span_def {
None => span_def = Some(tt.span()),
Some(span) => assert_same_span(tt.span(), span),
}
TokenTree::Punct(..) | TokenTree::Group(..) => match span_call {
None => span_call = Some(tt.span()),
Some(span) => assert_same_span(tt.span(), span),
}
}

}

result
}
12 changes: 8 additions & 4 deletions src/test/ui/macros/same-sequence-span.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,15 @@ LL | $(= $z:tt)*
error: `$x:expr` may be followed by `$y:tt`, which is not allowed for `expr` fragments
--> $DIR/same-sequence-span.rs:19:1
|
LL | proc_macro_sequence::make_foo!();
| ---------------------------------^^^^^^^^^^^^^
LL | proc_macro_sequence::make_foo!();
| ^--------------------------------
| |
| _in this macro invocation
| |
| not allowed after `expr` fragments
| in this macro invocation
LL | |
LL | |
LL | | fn main() {}
| |_________________________________^ not allowed after `expr` fragments
|
= note: allowed there are: `=>`, `,` or `;`
= note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info)
Expand Down

0 comments on commit dbf4910

Please sign in to comment.