Commit 13f8d07
committed
Auto merge of #51480 - dtolnay:lifetime, r=kennytm
Enable fall through past $:lifetime matcher
```rust
macro_rules! is_lifetime {
($lifetime:lifetime) => { true };
($other:tt) => { false };
}
fn main() {
println!("{}", is_lifetime!('lifetime));
println!("{}", is_lifetime!(@));
}
```
Before this fix, the `is_lifetime!` invocation would fail to compile with:
```
error: expected a lifetime, found `@`
--> src/main.rs:8:33
|
8 | println!("{}", is_lifetime!(@));
| ^
```
Fixes #50903.
Fixes #51477.
r? @kennytmFile tree
3 files changed
+52
-1
lines changed- src
- libsyntax/ext/tt
- test
- compile-fail
- run-pass
3 files changed
+52
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
827 | 827 | | |
828 | 828 | | |
829 | 829 | | |
| 830 | + | |
| 831 | + | |
| 832 | + | |
| 833 | + | |
| 834 | + | |
| 835 | + | |
| 836 | + | |
| 837 | + | |
830 | 838 | | |
831 | 839 | | |
832 | 840 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
16 | 16 | | |
17 | 17 | | |
18 | 18 | | |
19 | | - | |
| 19 | + | |
20 | 20 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
199 | 199 | | |
200 | 200 | | |
201 | 201 | | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
202 | 236 | | |
203 | 237 | | |
204 | 238 | | |
| |||
234 | 268 | | |
235 | 269 | | |
236 | 270 | | |
| 271 | + | |
| 272 | + | |
| 273 | + | |
| 274 | + | |
| 275 | + | |
| 276 | + | |
| 277 | + | |
| 278 | + | |
237 | 279 | | |
238 | 280 | | |
239 | 281 | | |
240 | 282 | | |
241 | 283 | | |
242 | 284 | | |
243 | 285 | | |
| 286 | + | |
244 | 287 | | |
245 | 288 | | |
0 commit comments