rust/tests/ui/parser/raw
Noratrieb 8a02724b9d Fix const items not being allowed to be called r#move or r#static
Because of an ambiguity with const closures, the parser needs to ensure
that for a const item, the `const` keyword isn't followed by a `move` or
`static` keyword, as that would indicate a const closure:

```rust
fn main() {
  const move // ...
}
```

This check did not take raw identifiers into account, therefore being
unable to distinguish between `const move` and `const r#move`. The
latter is obviously not a const closure, so it should be allowed as a
const item.

This fixes the check in the parser to only treat `const ...` as a const
closure if it's followed by the *proper keyword*, and not a raw
identifier.

Additionally, this adds a large test that tests for all raw identifiers in
all kinds of positions, including `const`, to prevent issues like this
one from occurring again.
2025-02-16 18:21:40 +01:00
..
issue-70677-panic-on-unterminated-raw-str-at-eof.rs
issue-70677-panic-on-unterminated-raw-str-at-eof.stderr Show number in error message even for one error 2023-11-24 19:15:52 +01:00
raw-byte-string-eof.rs
raw-byte-string-eof.stderr Show number in error message even for one error 2023-11-24 19:15:52 +01:00
raw-byte-string-literals.rs
raw-byte-string-literals.stderr Replace ASCII control chars with Unicode Control Pictures 2024-07-18 19:23:42 +00:00
raw-idents.rs Fix const items not being allowed to be called r#move or r#static 2025-02-16 18:21:40 +01:00
raw-literal-keywords.rs
raw-literal-keywords.stderr
raw-literal-self.rs
raw-literal-self.stderr Show number in error message even for one error 2023-11-24 19:15:52 +01:00
raw-literal-underscore.rs
raw-literal-underscore.stderr Show number in error message even for one error 2023-11-24 19:15:52 +01:00
raw-str-delim.rs
raw-str-delim.stderr Show number in error message even for one error 2023-11-24 19:15:52 +01:00
raw-str-in-macro-call.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
raw-str-unbalanced.rs
raw-str-unbalanced.stderr
raw-str-unterminated.rs
raw-str-unterminated.stderr Show number in error message even for one error 2023-11-24 19:15:52 +01:00
raw-string-2.rs
raw-string-2.stderr Show number in error message even for one error 2023-11-24 19:15:52 +01:00
raw-string.rs
raw-string.stderr Show number in error message even for one error 2023-11-24 19:15:52 +01:00
too-many-hash.rs
too-many-hash.stderr Show number in error message even for one error 2023-11-24 19:15:52 +01:00