]> git.lizzy.rs Git - rust.git/commitdiff
Fix typo in Delimited::open_tt
authorJulien Cretin <cretin@google.com>
Wed, 24 Jul 2019 21:21:25 +0000 (23:21 +0200)
committerJulien Cretin <cretin@google.com>
Sat, 27 Jul 2019 09:50:09 +0000 (11:50 +0200)
src/libsyntax/ext/tt/macro_rules.rs
src/libsyntax/ext/tt/quoted.rs
src/test/ui/macros/macro-follow.stderr

index 2a2df76d30c1d41111ba1c453d6b61bf736bada7..280bff8c1a1f028af3856a95ce3de21929cb690c 100644 (file)
@@ -748,7 +748,7 @@ fn add_all(&mut self, other: &Self) {
 }
 
 // Checks that `matcher` is internally consistent and that it
-// can legally by followed by a token N, for all N in `follow`.
+// can legally be followed by a token `N`, for all `N` in `follow`.
 // (If `follow` is empty, then it imposes no constraint on
 // the `matcher`.)
 //
index f67e4d368cc8fe86a6ddc153607c6b04e01e247e..cad94a0e4c12050b21a277f80be52025b39ea47b 100644 (file)
@@ -27,7 +27,7 @@ pub fn open_tt(&self, span: Span) -> TokenTree {
         let open_span = if span.is_dummy() {
             span
         } else {
-            span.with_lo(span.lo() + BytePos(self.delim.len() as u32))
+            span.with_hi(span.lo() + BytePos(self.delim.len() as u32))
         };
         TokenTree::token(token::OpenDelim(self.delim), open_span)
     }
index d3f081bb4a28f3b95fdde87fe782b33cc2b4e296..61ae79d235ee53f0f3fccd1e6a1559e7992f9d17 100644 (file)
@@ -1,24 +1,24 @@
 error: `$p:pat` is followed by `(`, which is not allowed for `pat` fragments
-  --> $DIR/macro-follow.rs:8:14
+  --> $DIR/macro-follow.rs:8:13
    |
 LL |     ($p:pat ()) => {};
-   |              ^ not allowed after `pat` fragments
+   |             ^ not allowed after `pat` fragments
    |
    = note: allowed there are: `=>`, `,`, `=`, `|`, `if` or `in`
 
 error: `$p:pat` is followed by `[`, which is not allowed for `pat` fragments
-  --> $DIR/macro-follow.rs:9:14
+  --> $DIR/macro-follow.rs:9:13
    |
 LL |     ($p:pat []) => {};
-   |              ^ not allowed after `pat` fragments
+   |             ^ not allowed after `pat` fragments
    |
    = note: allowed there are: `=>`, `,`, `=`, `|`, `if` or `in`
 
 error: `$p:pat` is followed by `{`, which is not allowed for `pat` fragments
-  --> $DIR/macro-follow.rs:10:14
+  --> $DIR/macro-follow.rs:10:13
    |
 LL |     ($p:pat {}) => {};
-   |              ^ not allowed after `pat` fragments
+   |             ^ not allowed after `pat` fragments
    |
    = note: allowed there are: `=>`, `,`, `=`, `|`, `if` or `in`
 
@@ -135,26 +135,26 @@ LL |     ($p:pat $m:meta) => {};
    = note: allowed there are: `=>`, `,`, `=`, `|`, `if` or `in`
 
 error: `$e:expr` is followed by `(`, which is not allowed for `expr` fragments
-  --> $DIR/macro-follow.rs:28:15
+  --> $DIR/macro-follow.rs:28:14
    |
 LL |     ($e:expr ()) => {};
-   |               ^ not allowed after `expr` fragments
+   |              ^ not allowed after `expr` fragments
    |
    = note: allowed there are: `=>`, `,` or `;`
 
 error: `$e:expr` is followed by `[`, which is not allowed for `expr` fragments
-  --> $DIR/macro-follow.rs:29:15
+  --> $DIR/macro-follow.rs:29:14
    |
 LL |     ($e:expr []) => {};
-   |               ^ not allowed after `expr` fragments
+   |              ^ not allowed after `expr` fragments
    |
    = note: allowed there are: `=>`, `,` or `;`
 
 error: `$e:expr` is followed by `{`, which is not allowed for `expr` fragments
-  --> $DIR/macro-follow.rs:30:15
+  --> $DIR/macro-follow.rs:30:14
    |
 LL |     ($e:expr {}) => {};
-   |               ^ not allowed after `expr` fragments
+   |              ^ not allowed after `expr` fragments
    |
    = note: allowed there are: `=>`, `,` or `;`
 
@@ -303,10 +303,10 @@ LL |     ($e:expr $m:meta) => {};
    = note: allowed there are: `=>`, `,` or `;`
 
 error: `$t:ty` is followed by `(`, which is not allowed for `ty` fragments
-  --> $DIR/macro-follow.rs:53:13
+  --> $DIR/macro-follow.rs:53:12
    |
 LL |     ($t:ty ()) => {};
-   |             ^ not allowed after `ty` fragments
+   |            ^ not allowed after `ty` fragments
    |
    = note: allowed there are: `{`, `[`, `=>`, `,`, `>`, `=`, `:`, `;`, `|`, `as` or `where`
 
@@ -407,26 +407,26 @@ LL |     ($t:ty $m:meta) => {};
    = note: allowed there are: `{`, `[`, `=>`, `,`, `>`, `=`, `:`, `;`, `|`, `as` or `where`
 
 error: `$s:stmt` is followed by `(`, which is not allowed for `stmt` fragments
-  --> $DIR/macro-follow.rs:71:15
+  --> $DIR/macro-follow.rs:71:14
    |
 LL |     ($s:stmt ()) => {};
-   |               ^ not allowed after `stmt` fragments
+   |              ^ not allowed after `stmt` fragments
    |
    = note: allowed there are: `=>`, `,` or `;`
 
 error: `$s:stmt` is followed by `[`, which is not allowed for `stmt` fragments
-  --> $DIR/macro-follow.rs:72:15
+  --> $DIR/macro-follow.rs:72:14
    |
 LL |     ($s:stmt []) => {};
-   |               ^ not allowed after `stmt` fragments
+   |              ^ not allowed after `stmt` fragments
    |
    = note: allowed there are: `=>`, `,` or `;`
 
 error: `$s:stmt` is followed by `{`, which is not allowed for `stmt` fragments
-  --> $DIR/macro-follow.rs:73:15
+  --> $DIR/macro-follow.rs:73:14
    |
 LL |     ($s:stmt {}) => {};
-   |               ^ not allowed after `stmt` fragments
+   |              ^ not allowed after `stmt` fragments
    |
    = note: allowed there are: `=>`, `,` or `;`
 
@@ -575,10 +575,10 @@ LL |     ($s:stmt $m:meta) => {};
    = note: allowed there are: `=>`, `,` or `;`
 
 error: `$p:path` is followed by `(`, which is not allowed for `path` fragments
-  --> $DIR/macro-follow.rs:95:15
+  --> $DIR/macro-follow.rs:95:14
    |
 LL |     ($p:path ()) => {};
-   |               ^ not allowed after `path` fragments
+   |              ^ not allowed after `path` fragments
    |
    = note: allowed there are: `{`, `[`, `=>`, `,`, `>`, `=`, `:`, `;`, `|`, `as` or `where`