rust/compiler/rustc_mir_build/src
许杰友 Jieyou Xu (Joe) 55b4549602
Show note for type ascription interpreted as a constant pattern, 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 commit extends the note for type ascription as a constant pattern
to `AscribeUserType` patterns as well.
2023-06-04 20:49:30 +08:00
..
build Separate AnonConst from ConstBlock in HIR. 2023-06-02 21:25:18 +00:00
thir Show note for type ascription interpreted as a constant pattern, not a new variable 2023-06-04 20:49:30 +08:00
check_unsafety.rs Auto merge of #106934 - DrMeepster:offset_of, r=WaffleLapkin 2023-04-22 00:10:44 +00:00
errors.rs Emit diagnostic for privately uninhabited uncovered witnesses. 2023-05-24 19:16:07 +00:00
lib.rs Remove lit_to_mir_constant query 2023-05-31 14:07:15 +00:00
lints.rs Rename Abort terminator to Terminate 2023-04-06 09:34:16 +01:00