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-24 19:35:59 -03:00
2023-05-30 12:40:35 +02:00
2023-05-30 13:03:40 +02:00
2023-05-08 17:58:01 -03:00
2023-05-26 06:55:06 +10:00
2023-05-04 18:06:07 +00:00
2023-05-12 00:10:52 +00:00
2023-05-29 12:07:41 -03:00
2023-05-24 19:35:59 -03:00
2023-05-11 12:14:57 -07:00
2023-05-08 17:58:01 -03:00
2023-05-24 19:35:59 -03:00
2023-05-30 13:04:25 +02:00
2023-06-03 09:22:47 +08:00
2023-05-25 17:40:46 +00:00
2023-05-24 21:15:50 -03:00
2023-05-08 03:36:30 +00:00
2023-05-12 00:10:52 +00:00
2023-05-24 19:54:13 -03:00
2023-05-05 14:58:52 -07:00
2023-05-08 03:36:30 +00:00
2023-05-29 12:07:41 -03:00
2023-05-26 18:55:02 +01:00
2023-05-16 20:30:48 +00:00
2023-05-12 00:10:52 +00:00
2023-05-24 19:35:59 -03:00