about summary refs log tree commit diff
diff options
context:
space:
mode:
authorAaron Hill <aa1ronham@gmail.com>2021-05-08 21:33:04 -0400
committerAaron Hill <aa1ronham@gmail.com>2021-05-12 00:51:31 -0400
commitdbf49102aac1515bd56c996fdfcfa20f7ee977ea (patch)
treee1021f8dd9d46623dc2f12e678a0fc16134570a3
parentf916b0474a0443c8ce9915efb59b7465b42e03f8 (diff)
downloadrust-dbf49102aac1515bd56c996fdfcfa20f7ee977ea.tar.gz
rust-dbf49102aac1515bd56c996fdfcfa20f7ee977ea.zip
Update stderr
The spans generated by `quote!` are (intentionally) no longer all the
same, so I removed that check entirely.
-rw-r--r--src/test/ui/hygiene/unpretty-debug.stdout2
-rw-r--r--src/test/ui/macros/auxiliary/proc_macro_sequence.rs19
-rw-r--r--src/test/ui/macros/same-sequence-span.stderr12
3 files changed, 9 insertions, 24 deletions
diff --git a/src/test/ui/hygiene/unpretty-debug.stdout b/src/test/ui/hygiene/unpretty-debug.stdout
index 96044a89289..e3445a4b80f 100644
--- a/src/test/ui/hygiene/unpretty-debug.stdout
+++ b/src/test/ui/hygiene/unpretty-debug.stdout
@@ -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)
diff --git a/src/test/ui/macros/auxiliary/proc_macro_sequence.rs b/src/test/ui/macros/auxiliary/proc_macro_sequence.rs
index cb8055de6e3..1331480d835 100644
--- a/src/test/ui/macros/auxiliary/proc_macro_sequence.rs
+++ b/src/test/ui/macros/auxiliary/proc_macro_sequence.rs
@@ -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
 }
diff --git a/src/test/ui/macros/same-sequence-span.stderr b/src/test/ui/macros/same-sequence-span.stderr
index 63b8b29d6ce..911775eb417 100644
--- a/src/test/ui/macros/same-sequence-span.stderr
+++ b/src/test/ui/macros/same-sequence-span.stderr
@@ -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)