ff2f7a7a83
After: ``` error[E0005]: refutable pattern in local binding --> $DIR/bad-pattern.rs:19:13 | LL | const PAT: u32 = 0; | -------------- missing patterns are not covered because `PAT` is interpreted as a constant pattern, not a new variable ... LL | let PAT = v1; | ^^^ | | | pattern `1_u32..=u32::MAX` not covered | help: introduce a variable instead: `PAT_var` | = note: `let` bindings require an "irrefutable pattern", like a `struct` or an `enum` with only one variant = note: for more information, visit https://doc.rust-lang.org/book/ch18-02-refutability.html = note: the matched value is of type `u32` ``` Before: ``` error[E0005]: refutable pattern in local binding --> $DIR/bad-pattern.rs:19:13 | LL | let PAT = v1; | ^^^ | | | pattern `1_u32..=u32::MAX` not covered | missing patterns are not covered because `PAT` is interpreted as a constant pattern, not a new variable | help: introduce a variable instead: `PAT_var` | = note: `let` bindings require an "irrefutable pattern", like a `struct` or an `enum` with only one variant = note: for more information, visit https://doc.rust-lang.org/book/ch18-02-refutability.html = note: the matched value is of type `u32` ```
10 lines
354 B
Rust
10 lines
354 B
Rust
fn main() {
|
|
let A = 3;
|
|
//~^ ERROR refutable pattern in local binding
|
|
//~| patterns `i32::MIN..=1_i32` and `3_i32..=i32::MAX` not covered
|
|
//~| HELP introduce a variable instead
|
|
//~| SUGGESTION A_var
|
|
|
|
const A: i32 = 2;
|
|
//~^ missing patterns are not covered because `A` is interpreted as a constant pattern, not a new variable
|
|
}
|