Skip to content

Commit 42a3281

Browse files
authored
Rollup merge of #62954 - ia0:fix_typo_span, r=Centril
Fix typo in Delimited::open_tt
2 parents d727071 + f176bcf commit 42a3281

File tree

3 files changed

+24
-24
lines changed

3 files changed

+24
-24
lines changed

src/libsyntax/ext/tt/macro_rules.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -751,7 +751,7 @@ impl TokenSet {
751751
}
752752

753753
// Checks that `matcher` is internally consistent and that it
754-
// can legally by followed by a token N, for all N in `follow`.
754+
// can legally be followed by a token `N`, for all `N` in `follow`.
755755
// (If `follow` is empty, then it imposes no constraint on
756756
// the `matcher`.)
757757
//

src/libsyntax/ext/tt/quoted.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ impl Delimited {
2727
let open_span = if span.is_dummy() {
2828
span
2929
} else {
30-
span.with_lo(span.lo() + BytePos(self.delim.len() as u32))
30+
span.with_hi(span.lo() + BytePos(self.delim.len() as u32))
3131
};
3232
TokenTree::token(token::OpenDelim(self.delim), open_span)
3333
}

src/test/ui/macros/macro-follow.stderr

+22-22
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,24 @@
11
error: `$p:pat` is followed by `(`, which is not allowed for `pat` fragments
2-
--> $DIR/macro-follow.rs:8:14
2+
--> $DIR/macro-follow.rs:8:13
33
|
44
LL | ($p:pat ()) => {};
5-
| ^ not allowed after `pat` fragments
5+
| ^ not allowed after `pat` fragments
66
|
77
= note: allowed there are: `=>`, `,`, `=`, `|`, `if` or `in`
88

99
error: `$p:pat` is followed by `[`, which is not allowed for `pat` fragments
10-
--> $DIR/macro-follow.rs:9:14
10+
--> $DIR/macro-follow.rs:9:13
1111
|
1212
LL | ($p:pat []) => {};
13-
| ^ not allowed after `pat` fragments
13+
| ^ not allowed after `pat` fragments
1414
|
1515
= note: allowed there are: `=>`, `,`, `=`, `|`, `if` or `in`
1616

1717
error: `$p:pat` is followed by `{`, which is not allowed for `pat` fragments
18-
--> $DIR/macro-follow.rs:10:14
18+
--> $DIR/macro-follow.rs:10:13
1919
|
2020
LL | ($p:pat {}) => {};
21-
| ^ not allowed after `pat` fragments
21+
| ^ not allowed after `pat` fragments
2222
|
2323
= note: allowed there are: `=>`, `,`, `=`, `|`, `if` or `in`
2424

@@ -135,26 +135,26 @@ LL | ($p:pat $m:meta) => {};
135135
= note: allowed there are: `=>`, `,`, `=`, `|`, `if` or `in`
136136

137137
error: `$e:expr` is followed by `(`, which is not allowed for `expr` fragments
138-
--> $DIR/macro-follow.rs:28:15
138+
--> $DIR/macro-follow.rs:28:14
139139
|
140140
LL | ($e:expr ()) => {};
141-
| ^ not allowed after `expr` fragments
141+
| ^ not allowed after `expr` fragments
142142
|
143143
= note: allowed there are: `=>`, `,` or `;`
144144

145145
error: `$e:expr` is followed by `[`, which is not allowed for `expr` fragments
146-
--> $DIR/macro-follow.rs:29:15
146+
--> $DIR/macro-follow.rs:29:14
147147
|
148148
LL | ($e:expr []) => {};
149-
| ^ not allowed after `expr` fragments
149+
| ^ not allowed after `expr` fragments
150150
|
151151
= note: allowed there are: `=>`, `,` or `;`
152152

153153
error: `$e:expr` is followed by `{`, which is not allowed for `expr` fragments
154-
--> $DIR/macro-follow.rs:30:15
154+
--> $DIR/macro-follow.rs:30:14
155155
|
156156
LL | ($e:expr {}) => {};
157-
| ^ not allowed after `expr` fragments
157+
| ^ not allowed after `expr` fragments
158158
|
159159
= note: allowed there are: `=>`, `,` or `;`
160160

@@ -303,10 +303,10 @@ LL | ($e:expr $m:meta) => {};
303303
= note: allowed there are: `=>`, `,` or `;`
304304

305305
error: `$t:ty` is followed by `(`, which is not allowed for `ty` fragments
306-
--> $DIR/macro-follow.rs:53:13
306+
--> $DIR/macro-follow.rs:53:12
307307
|
308308
LL | ($t:ty ()) => {};
309-
| ^ not allowed after `ty` fragments
309+
| ^ not allowed after `ty` fragments
310310
|
311311
= note: allowed there are: `{`, `[`, `=>`, `,`, `>`, `=`, `:`, `;`, `|`, `as` or `where`
312312

@@ -407,26 +407,26 @@ LL | ($t:ty $m:meta) => {};
407407
= note: allowed there are: `{`, `[`, `=>`, `,`, `>`, `=`, `:`, `;`, `|`, `as` or `where`
408408

409409
error: `$s:stmt` is followed by `(`, which is not allowed for `stmt` fragments
410-
--> $DIR/macro-follow.rs:71:15
410+
--> $DIR/macro-follow.rs:71:14
411411
|
412412
LL | ($s:stmt ()) => {};
413-
| ^ not allowed after `stmt` fragments
413+
| ^ not allowed after `stmt` fragments
414414
|
415415
= note: allowed there are: `=>`, `,` or `;`
416416

417417
error: `$s:stmt` is followed by `[`, which is not allowed for `stmt` fragments
418-
--> $DIR/macro-follow.rs:72:15
418+
--> $DIR/macro-follow.rs:72:14
419419
|
420420
LL | ($s:stmt []) => {};
421-
| ^ not allowed after `stmt` fragments
421+
| ^ not allowed after `stmt` fragments
422422
|
423423
= note: allowed there are: `=>`, `,` or `;`
424424

425425
error: `$s:stmt` is followed by `{`, which is not allowed for `stmt` fragments
426-
--> $DIR/macro-follow.rs:73:15
426+
--> $DIR/macro-follow.rs:73:14
427427
|
428428
LL | ($s:stmt {}) => {};
429-
| ^ not allowed after `stmt` fragments
429+
| ^ not allowed after `stmt` fragments
430430
|
431431
= note: allowed there are: `=>`, `,` or `;`
432432

@@ -575,10 +575,10 @@ LL | ($s:stmt $m:meta) => {};
575575
= note: allowed there are: `=>`, `,` or `;`
576576

577577
error: `$p:path` is followed by `(`, which is not allowed for `path` fragments
578-
--> $DIR/macro-follow.rs:95:15
578+
--> $DIR/macro-follow.rs:95:14
579579
|
580580
LL | ($p:path ()) => {};
581-
| ^ not allowed after `path` fragments
581+
| ^ not allowed after `path` fragments
582582
|
583583
= note: allowed there are: `{`, `[`, `=>`, `,`, `>`, `=`, `:`, `;`, `|`, `as` or `where`
584584

0 commit comments

Comments
 (0)