rust/compiler/rustc_parse
Guillaume Gomez 8482454209
Rollup merge of #145903 - Kivooeo:c-style-pointer, r=davidtwco
Give correct suggestion for a typo in raw pointers

This adds a check for when user wrote `const* T` instead of `*const T`, I just saw how a C-person made this typo and compiler suggests this

```rust
 --> src/main.rs:2:17
  |
2 |     let p: const* u8 = 0 as _;
  |                 ^
  |
help: add `mut` or `const` here
  |
2 |     let p: const*mut  u8 = 0 as _;
  |                  +++
2 |     let p: const*const  u8 = 0 as _;
  |                  +++++
```

which is very incorrect

also fixes https://github.com/rust-lang/rust/issues/136602

r? compiler
2025-11-03 17:20:31 +01:00
..
2025-10-30 08:05:37 +00:00