1
Fork 0

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:
Michael Goulet 2023-01-11 22:25:47 -08:00 committed by GitHub
commit 83d3b76ac2
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
39 changed files with 568 additions and 488 deletions

View file

@ -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!() };
| ++++++++++++++++

View file

@ -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