Matthias Krüger
f0710999a9
Rollup merge of #137140 - Noratrieb:const-move, r=jieyouxu,compiler-errors
...
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.
fixes #137128
2025-02-17 06:37:39 +01:00
..
2025-02-09 20:45:47 -08:00
2025-02-10 20:21:39 +00:00
2025-02-10 20:21:39 +00:00
2025-02-10 20:21:39 +00:00
2025-02-12 20:09:56 -05:00
2025-02-14 00:37:23 +01:00
2025-02-10 20:21:39 +00:00
2025-02-10 20:21:39 +00:00
2025-02-10 20:21:39 +00:00
2025-02-14 00:44:10 -08:00
2025-02-12 20:09:56 -05:00
2025-02-15 16:47:30 +01:00
2025-02-13 23:49:09 +01:00
2025-02-10 20:21:39 +00:00
2025-02-10 20:21:39 +00:00
2025-02-15 21:49:53 +00:00
2025-02-10 20:21:39 +00:00
2025-02-14 00:44:10 -08:00
2025-02-10 20:21:39 +00:00
2025-02-14 00:44:10 -08:00
2025-02-14 00:44:10 -08:00
2025-02-14 14:05:27 -08:00
2025-02-13 03:53:32 -05:00
2025-02-06 23:44:23 +01:00
2025-02-10 20:21:39 +00:00
2025-02-15 03:41:07 +01:00
2025-02-14 00:44:10 -08:00
2025-02-10 20:21:39 +00:00
2025-02-10 20:21:39 +00:00
2025-02-14 00:44:10 -08:00
2025-02-14 00:44:10 -08:00
2025-02-11 01:02:43 -05:00
2025-02-10 20:21:39 +00:00
2025-02-10 20:21:39 +00:00
2025-02-09 10:05:13 -06:00
2025-02-14 00:37:23 +01:00
2025-02-10 20:21:39 +00:00
2025-02-10 20:21:39 +00:00
2025-02-10 20:21:39 +00:00
2025-02-09 20:40:43 +08:00
2025-02-10 20:21:39 +00:00
2025-02-10 20:21:39 +00:00
2025-02-11 09:19:37 +00:00
2025-02-14 00:44:10 -08:00
2025-02-10 20:21:39 +00:00
2025-02-14 00:44:10 -08:00
2025-02-14 00:44:10 -08:00
2025-02-15 20:38:14 +00:00
2025-02-10 20:21:39 +00:00
2025-02-06 23:44:23 +01:00
2025-02-14 00:44:10 -08:00
2025-02-10 20:21:39 +00:00
2025-02-10 20:21:39 +00:00
2025-02-14 00:44:10 -08:00
2025-02-14 00:44:10 -08:00
2025-02-10 20:21:39 +00:00
2025-02-10 20:21:39 +00:00
2025-02-10 20:21:39 +00:00
2025-02-14 00:44:10 -08:00
2025-02-17 09:30:40 +11:00
2025-02-14 00:44:10 -08:00
2025-02-10 20:21:39 +00:00
2025-02-10 20:21:39 +00:00
2025-02-10 20:21:39 +00:00
2025-02-10 20:21:39 +00:00
2025-02-10 20:21:39 +00:00
2025-02-15 07:44:20 +08:00
2025-02-10 20:21:39 +00:00
2025-02-10 20:21:39 +00:00
2025-02-10 20:21:39 +00:00
2025-02-10 20:21:39 +00:00
2025-02-14 14:05:23 -08:00
2025-02-14 00:44:10 -08:00
2025-02-10 20:21:39 +00:00
2025-02-14 00:37:23 +01:00
2025-02-10 20:21:39 +00:00
2025-02-10 20:21:39 +00:00
2025-02-09 20:45:47 -08:00
2025-02-15 03:41:07 +01:00
2025-02-15 16:47:30 +01:00
2025-02-14 00:44:10 -08:00
2025-02-10 20:21:39 +00:00
2025-02-10 13:01:55 +00:00
2025-02-10 20:21:39 +00:00
2025-02-12 20:09:56 -05:00
2025-02-13 03:45:04 +00:00
2025-02-14 00:44:10 -08:00
2025-02-14 00:44:10 -08:00
2025-02-14 00:44:10 -08:00
2025-02-11 19:42:47 -08:00
2025-02-07 16:02:19 +00:00
2025-02-16 16:34:51 +03:00
2025-02-10 20:21:39 +00:00
2025-02-08 16:33:36 +00:00
2025-02-14 00:44:10 -08:00
2025-02-10 20:21:39 +00:00
2025-02-14 00:44:10 -08:00
2025-02-10 20:21:39 +00:00
2025-02-14 00:44:10 -08:00
2025-02-14 00:44:10 -08:00
2025-02-14 00:44:10 -08:00
2025-02-10 20:21:39 +00:00
2025-02-14 00:44:10 -08:00
2025-02-14 00:44:10 -08:00
2025-02-10 20:21:39 +00:00
2025-02-14 00:44:10 -08:00
2025-02-10 20:21:39 +00:00
2025-02-10 20:21:39 +00:00
2025-02-10 20:21:39 +00:00
2025-02-10 20:21:39 +00:00
2025-02-10 20:21:39 +00:00
2025-02-12 20:09:56 -05:00
2025-02-16 18:21:40 +01:00
2025-02-17 09:30:40 +11:00
2025-02-14 00:44:10 -08:00
2025-02-11 19:42:47 -08:00
2025-02-07 10:43:50 +00:00
2025-02-14 00:44:10 -08:00
2025-02-10 20:21:39 +00:00
2025-02-10 20:21:39 +00:00
2025-02-10 20:21:39 +00:00
2025-02-14 00:44:10 -08:00
2025-02-14 00:44:10 -08:00
2025-02-10 20:21:39 +00:00
2025-02-14 00:44:10 -08:00
2025-02-10 20:21:39 +00:00
2025-02-06 23:44:23 +01:00
2025-02-11 05:27:49 +00:00
2025-02-10 20:21:39 +00:00
2025-02-10 20:21:39 +00:00
2025-02-13 23:49:09 +01:00
2025-02-14 00:44:10 -08:00
2025-02-10 20:21:39 +00:00
2025-02-14 00:44:10 -08:00
2025-02-10 20:21:39 +00:00
2025-02-10 20:21:39 +00:00
2025-02-14 00:44:10 -08:00
2025-02-14 16:23:27 +01:00
2025-02-15 07:44:20 +08:00
2025-02-11 20:18:01 -08:00
2025-02-14 19:47:52 +01:00
2025-02-14 00:44:10 -08:00
2025-02-11 09:19:37 +00:00
2025-02-14 16:23:32 +01:00
2025-02-14 00:44:10 -08:00
2025-02-10 20:21:39 +00:00
2025-02-14 00:44:10 -08:00
2025-02-10 20:21:39 +00:00
2025-02-11 23:47:56 +00:00
2025-02-14 00:37:23 +01:00
2025-02-14 00:44:10 -08:00
2025-02-10 20:21:39 +00:00
2025-02-10 20:21:39 +00:00
2025-02-10 20:21:39 +00:00
2025-02-10 20:21:39 +00:00
2025-02-10 20:21:39 +00:00
2025-02-16 09:08:24 +00:00
2025-02-14 00:44:10 -08:00
2025-02-13 03:45:07 +00:00
2025-02-11 09:19:37 +00:00
2025-02-10 20:21:39 +00:00
2025-02-10 20:21:39 +00:00
2025-02-10 20:21:39 +00:00
2025-02-10 20:21:39 +00:00
2025-02-10 20:21:39 +00:00
2025-02-14 00:44:10 -08:00
2025-02-10 20:21:39 +00:00
2025-02-15 20:02:16 +01:00
2025-02-15 20:02:16 +01:00
2025-02-15 20:02:16 +01:00
2025-02-15 20:02:16 +01:00
2025-02-15 20:02:16 +01:00
2025-02-15 20:02:16 +01:00
2025-02-15 20:02:16 +01:00
2025-02-15 20:02:16 +01:00
2025-02-15 20:02:16 +01:00
2025-02-15 20:02:16 +01:00
2025-02-10 20:21:39 +00:00