Rollup merge of #106097 - mejrs:mir_build2, r=oli-obk
Migrate mir_build diagnostics 2 of 3 The first three commits are fairly boring, however I've made some changes to the output of the match checking diagnostics.
This commit is contained in:
commit
83d3b76ac2
39 changed files with 568 additions and 488 deletions
|
@ -1,4 +1,4 @@
|
|||
error[E0005]: refutable pattern in local binding: `None` not covered
|
||||
error[E0005]: refutable pattern in local binding
|
||||
--> $DIR/E0005.rs:3:9
|
||||
|
|
||||
LL | let Some(y) = x;
|
||||
|
@ -6,17 +6,8 @@ LL | let Some(y) = x;
|
|||
|
|
||||
= 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: `Option<i32>` defined here
|
||||
--> $SRC_DIR/core/src/option.rs:LL:COL
|
||||
::: $SRC_DIR/core/src/option.rs:LL:COL
|
||||
|
|
||||
= note: not covered
|
||||
= note: the matched value is of type `Option<i32>`
|
||||
help: you might want to use `if let` to ignore the variant that isn't matched
|
||||
|
|
||||
LL | let y = if let Some(y) = x { y } else { todo!() };
|
||||
| ++++++++++ ++++++++++++++++++++++
|
||||
help: alternatively, you might want to use let else to handle the variant that isn't matched
|
||||
help: you might want to use `let else` to handle the variant that isn't matched
|
||||
|
|
||||
LL | let Some(y) = x else { todo!() };
|
||||
| ++++++++++++++++
|
||||
|
|
|
@ -1,14 +1,9 @@
|
|||
error[E0005]: refutable pattern in `for` loop binding: `None` not covered
|
||||
error[E0005]: refutable pattern in `for` loop binding
|
||||
--> $DIR/E0297.rs:4:9
|
||||
|
|
||||
LL | for Some(x) in xs {}
|
||||
| ^^^^^^^ pattern `None` not covered
|
||||
|
|
||||
note: `Option<i32>` defined here
|
||||
--> $SRC_DIR/core/src/option.rs:LL:COL
|
||||
::: $SRC_DIR/core/src/option.rs:LL:COL
|
||||
|
|
||||
= note: not covered
|
||||
= note: the matched value is of type `Option<i32>`
|
||||
|
||||
error: aborting due to previous error
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue