bors e4106065bf Auto merge of #112272 - jieyouxu:issue-112269, r=compiler-errors
Show note for type ascription on a local binding interpreted as a constant pattern and not a new variable

Given the code

```rust
pub fn main() {
    const y: i32 = 4;
    let y: i32 = 3;
}
```

`y` in the let binding is actually interpreted as a constant pattern and is not a new variable, causing confusing diagnostics about refutable patterns in local binding.

This PR extends the note for type ascription of a constant pattern to `AscribeUserType` patterns which have `Constant` subpatterns.

Fixes #112269.
2023-06-05 01:33:58 +00:00
..
2023-05-29 18:37:53 +02:00
2023-05-30 12:40:35 +02:00
2023-05-30 13:03:40 +02:00
2023-05-29 12:07:41 -03:00
2023-05-30 13:04:25 +02:00
2023-06-03 09:22:47 +08:00
2023-05-29 12:07:41 -03:00
2023-05-26 18:55:02 +01:00