rust/tests
Jonathan Brouwer 9ef76797ea
Rollup merge of #150590 - ident-kw-ice, r=petrochenkov
Don't try to recover keyword as non-keyword identifier

Fixes rust-lang/rust#149692.

On beta after rust-lang/rust#146978, we ICE on

```rs
macro_rules! m {
    ($id:item()) => {}
}

m!(Self());
```

where `Self` in the macro invocation is a keyword not a "normal" identifier, while attempting to recover an missing keyword before an identifier. Except, `Self` *is* a keyword, so trying to parse that as a non-reserved identifier expectedly fails.

I suspect rust-lang/rust#146978 merely unmasked a possible code path to hit this case; this logic has been so for a good while. Previously, on stable, the error message looks something like

```rs
error: expected identifier, found keyword `Self`
 --> src/lib.rs:5:4
  |
5 | m!(Self());
  |    ^^^^ expected identifier, found keyword

error: missing `fn` or `struct` for function or struct definition
 --> src/lib.rs:5:4
  |
2 |     ($id:item()) => {}
  |      -------- while parsing argument for this `item` macro fragment
...
5 | m!(Self());
  |    ^^^^
  |
help: if you meant to call a macro, try
  |
5 | m!(Self!());
  |        +
```

I considered restoring this diagnostic, but I'm not super convinced it's worth the complexity (and to me, it's not super clear what the user actually intended here).
2026-01-14 22:29:56 +01:00
..
assembly-llvm Rollup merge of #150826 - s390x-asm-f16-vector, r=uweigand,tgross35 2026-01-13 09:01:29 +01:00
auxiliary Rollup merge of #150368 - minicore-ordering, r=workingjubilee 2026-01-11 09:56:38 +01:00
codegen-llvm Auto merge of #130998 - the8472:bail-before-memcpy, r=nnethercote 2026-01-14 16:36:26 +00:00
codegen-units address review comments; fix CI 2026-01-01 19:17:11 -05:00
coverage Create place and value indices on-demand. 2025-12-14 16:33:24 +00:00
coverage-run-rustdoc
crashes Bless other tests 2026-01-07 09:33:40 +08:00
debuginfo tests/debuginfo/macro-stepping.rs: Add revisions default-mir-passes, no-SingleUseConsts-mir-pass 2025-12-23 15:33:56 +01:00
incremental Bless other tests 2026-01-07 09:33:40 +08:00
mir-opt Auto merge of #150748 - nnethercote:canonicalizer-cleanups, r=lcnr 2026-01-11 22:58:38 +00:00
pretty Explicitly export core and std macros 2026-01-13 08:47:48 +01:00
run-make Rollup merge of #151036 - issue-151026, r=mati865 2026-01-14 11:05:40 +01:00
run-make-cargo tests/run-make-cargo/same-crate-name-and-macro-name: New regression test 2025-12-17 11:21:27 +01:00
rustdoc-gui Reduce flakyness for tests/rustdoc-gui/notable-trait.goml 2026-01-13 10:22:34 +01:00
rustdoc-html Rollup merge of #150586 - intra-doc-assoc-alias, r=GuillaumeGomez 2026-01-14 22:29:55 +01:00
rustdoc-js Auto merge of #149370 - Zalathar:rollup-6fkk5x4, r=Zalathar 2025-11-27 07:30:25 +00:00
rustdoc-js-std Explicitly export core and std macros 2026-01-13 08:47:48 +01:00
rustdoc-json
rustdoc-ui Rollup merge of #150934 - move-doc-attr-checks, r=JonathanBrouwer 2026-01-13 09:01:31 +01:00
ui Rollup merge of #150590 - ident-kw-ice, r=petrochenkov 2026-01-14 22:29:56 +01:00
ui-fulldeps Rollup merge of #151096 - rm-providers-deref, r=oli-obk 2026-01-14 11:05:42 +01:00
COMPILER_TESTS.md