diff options
| author | mejrs <> | 2022-12-23 21:02:23 +0100 |
|---|---|---|
| committer | David Tolnay <dtolnay@gmail.com> | 2023-01-11 14:40:02 -0800 |
| commit | 31c20210b9683f983953e1a4e45db94146b3c7cb (patch) | |
| tree | e75765ba780b71da1998109e22abe6b64905086e /tests/ui/feature-gates | |
| parent | ef3307289056ac3151a1a6eb29065932e5326bcf (diff) | |
| download | rust-31c20210b9683f983953e1a4e45db94146b3c7cb.tar.gz rust-31c20210b9683f983953e1a4e45db94146b3c7cb.zip | |
Migrate pattern matching
Diffstat (limited to 'tests/ui/feature-gates')
| -rw-r--r-- | tests/ui/feature-gates/feature-gate-exhaustive-patterns.stderr | 9 |
1 files changed, 2 insertions, 7 deletions
diff --git a/tests/ui/feature-gates/feature-gate-exhaustive-patterns.stderr b/tests/ui/feature-gates/feature-gate-exhaustive-patterns.stderr index e253e4791e8..5e4df7422fc 100644 --- a/tests/ui/feature-gates/feature-gate-exhaustive-patterns.stderr +++ b/tests/ui/feature-gates/feature-gate-exhaustive-patterns.stderr @@ -1,4 +1,4 @@ -error[E0005]: refutable pattern in local binding: `Err(_)` not covered +error[E0005]: refutable pattern in local binding --> $DIR/feature-gate-exhaustive-patterns.rs:8:9 | LL | let Ok(_x) = foo(); @@ -6,17 +6,12 @@ LL | let Ok(_x) = foo(); | = 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: `Result<u32, !>` defined here - --> $SRC_DIR/core/src/result.rs:LL:COL - ::: $SRC_DIR/core/src/result.rs:LL:COL - | - = note: not covered = note: the matched value is of type `Result<u32, !>` help: you might want to use `if let` to ignore the variant that isn't matched | LL | let _x = if let Ok(_x) = foo() { _x } else { todo!() }; | +++++++++++ +++++++++++++++++++++++ -help: alternatively, you might want to use let else to handle the variant that isn't matched +help: alternatively, you might want to use `let else` to handle the variant that isn't matched | LL | let Ok(_x) = foo() else { todo!() }; | ++++++++++++++++ |
