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-06-01 14:45:18 +00:00
2023-05-27 18:49:07 +08:00
2023-06-02 21:25:18 +00:00
2023-06-03 09:44:30 +08:00
2023-05-25 23:49:35 +00:00
2023-06-01 11:09:43 +05:30
2023-05-29 07:10:44 +00:00
2023-06-02 16:02:06 -07:00
2023-06-01 14:45:18 +00:00
2023-06-02 18:12:45 +02:00
2023-06-02 16:02:06 -07:00
2023-06-02 16:02:06 -07:00
2023-06-02 12:34:01 -05:00
2023-05-29 09:23:43 +10:00
2023-06-01 18:21:42 +00:00
2023-06-01 14:45:18 +00:00
2023-06-02 07:57:21 +00:00
2023-05-29 09:23:43 +10:00
2023-06-03 09:44:30 +08:00
2023-06-02 21:25:18 +00:00
2023-06-02 16:02:06 -07:00
2023-06-02 21:25:18 +00:00
2023-06-04 10:56:00 +02:00
2023-05-25 23:49:35 +00:00
2023-05-25 00:33:43 +00:00
2023-06-02 22:07:57 +00:00
2023-05-25 23:49:35 +00:00
2023-06-01 22:47:30 +02:00
2023-05-31 10:24:17 +00:00
2023-05-26 15:18:54 -04:00
2023-06-01 14:45:18 +00:00
2023-06-02 21:25:18 +00:00
2023-06-02 16:02:06 -07:00
2023-06-04 20:49:30 +08:00
2023-05-29 17:15:48 +02:00
2023-06-04 03:39:24 +00:00
2023-06-02 13:07:30 +10:00
2023-05-29 07:10:44 +00:00
2023-06-02 21:25:18 +00:00
2023-06-01 06:14:06 +00:00
2023-05-26 13:03:47 +03:00
2023-05-25 23:49:35 +00:00
2023-05-29 09:23:43 +10:00
2023-06-01 05:32:00 +00:00
2023-05-25 17:40:46 +00:00
2023-06-01 01:27:32 +00:00
2023-06-02 18:12:45 +02:00
2023-06-02 07:57:21 +00:00
2023-06-03 20:38:10 +02:00
2023-05-29 17:54:53 +00:00
2023-06-02 21:25:18 +00:00
2023-05-26 18:55:02 +01:00