about summary refs log tree commit diff
path: root/src/libsyntax_ext
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2019-06-08 01:34:53 +0000
committerbors <bors@rust-lang.org>2019-06-08 01:34:53 +0000
commit6312b89fdabce0aedf613391266e08c0deef2324 (patch)
treee83b9416488a0e17858bf4e24a51810c003c4712 /src/libsyntax_ext
parentd132f544f9d74e3cc047ef211e57eae60b78e5c5 (diff)
parentb3bdc24a89de1b014490fed3394cd359430eec9f (diff)
downloadrust-6312b89fdabce0aedf613391266e08c0deef2324.tar.gz
rust-6312b89fdabce0aedf613391266e08c0deef2324.zip
Auto merge of #61649 - Centril:rollup-b4nx9k9, r=Centril
Rollup of 7 pull requests

Successful merges:

 - #61223 (Document tuple's Ord behavior as sequential)
 - #61615 (syntax: Treat error literals in more principled way)
 - #61616 (parser: Remove `Deref` impl from `Parser`)
 - #61621 (Clarify when we run steps with ONLY_HOSTS)
 - #61627 (Add regression test for #61452.)
 - #61641 (Revert "Make LocalAnalizer visitor iterate instead of recurse")
 - #61647 (Use stable wrappers in f32/f64::signum)

Failed merges:

r? @ghost
Diffstat (limited to 'src/libsyntax_ext')
-rw-r--r--src/libsyntax_ext/assert.rs4
-rw-r--r--src/libsyntax_ext/concat.rs4
-rw-r--r--src/libsyntax_ext/format.rs4
3 files changed, 7 insertions, 5 deletions
diff --git a/src/libsyntax_ext/assert.rs b/src/libsyntax_ext/assert.rs
index 3886528c74c..10d323ffb89 100644
--- a/src/libsyntax_ext/assert.rs
+++ b/src/libsyntax_ext/assert.rs
@@ -85,7 +85,7 @@ fn parse_assert<'a>(
     if parser.token == token::Semi {
         let mut err = cx.struct_span_warn(sp, "macro requires an expression as an argument");
         err.span_suggestion(
-            parser.span,
+            parser.token.span,
             "try removing semicolon",
             String::new(),
             Applicability::MaybeIncorrect
@@ -105,7 +105,7 @@ fn parse_assert<'a>(
     // turned into an error.
     let custom_message = if let token::Literal(token::Lit { kind: token::Str, .. })
                                 = parser.token.kind {
-        let mut err = cx.struct_span_warn(parser.span, "unexpected string literal");
+        let mut err = cx.struct_span_warn(parser.token.span, "unexpected string literal");
         let comma_span = cx.source_map().next_point(parser.prev_span);
         err.span_suggestion_short(
             comma_span,
diff --git a/src/libsyntax_ext/concat.rs b/src/libsyntax_ext/concat.rs
index 230b00c0f8f..68d5178372e 100644
--- a/src/libsyntax_ext/concat.rs
+++ b/src/libsyntax_ext/concat.rs
@@ -22,7 +22,6 @@ pub fn expand_syntax_ext(
         match e.node {
             ast::ExprKind::Lit(ref lit) => match lit.node {
                 ast::LitKind::Str(ref s, _)
-                | ast::LitKind::Err(ref s)
                 | ast::LitKind::Float(ref s, _)
                 | ast::LitKind::FloatUnsuffixed(ref s) => {
                     accumulator.push_str(&s.as_str());
@@ -41,6 +40,9 @@ pub fn expand_syntax_ext(
                 ast::LitKind::Byte(..) | ast::LitKind::ByteStr(..) => {
                     cx.span_err(e.span, "cannot concatenate a byte string literal");
                 }
+                ast::LitKind::Err(_) => {
+                    has_errors = true;
+                }
             },
             ast::ExprKind::Err => {
                 has_errors = true;
diff --git a/src/libsyntax_ext/format.rs b/src/libsyntax_ext/format.rs
index c78215b77a9..377164728f4 100644
--- a/src/libsyntax_ext/format.rs
+++ b/src/libsyntax_ext/format.rs
@@ -142,7 +142,7 @@ fn parse_args<'a>(
 
     while p.token != token::Eof {
         if !p.eat(&token::Comma) {
-            return Err(ecx.struct_span_err(p.span, "expected token: `,`"));
+            return Err(ecx.struct_span_err(p.token.span, "expected token: `,`"));
         }
         if p.token == token::Eof {
             break;
@@ -154,7 +154,7 @@ fn parse_args<'a>(
                 name
             } else {
                 return Err(ecx.struct_span_err(
-                    p.span,
+                    p.token.span,
                     "expected ident, positional arguments cannot follow named arguments",
                 ));
             };