diff options
| author | Camille GILLOT <gillot.camille@gmail.com> | 2022-02-13 16:27:59 +0100 |
|---|---|---|
| committer | Camille GILLOT <gillot.camille@gmail.com> | 2022-07-01 17:39:19 +0200 |
| commit | 42e4eee8931479a02c11c88ddaddb3a494e136c6 (patch) | |
| tree | a1b3bade4e24fbe6bbcff84376aed94bc6505257 /src/test/ui/pattern | |
| parent | ca1e68b3229e710c3948a361ee770d846a88e6da (diff) | |
| download | rust-42e4eee8931479a02c11c88ddaddb3a494e136c6.tar.gz rust-42e4eee8931479a02c11c88ddaddb3a494e136c6.zip | |
Shorten def_span for more items.
Diffstat (limited to 'src/test/ui/pattern')
10 files changed, 57 insertions, 105 deletions
diff --git a/src/test/ui/pattern/pat-tuple-field-count-cross.stderr b/src/test/ui/pattern/pat-tuple-field-count-cross.stderr index 07b678bc873..019cd414d2e 100644 --- a/src/test/ui/pattern/pat-tuple-field-count-cross.stderr +++ b/src/test/ui/pattern/pat-tuple-field-count-cross.stderr @@ -16,9 +16,9 @@ LL | Z0() => {} ::: $DIR/auxiliary/declarations-for-tuple-field-count-errors.rs:1:1 | LL | pub struct Z0; - | -------------- `Z0` defined here + | ------------- `Z0` defined here LL | pub struct Z1(); - | ---------------- similarly named tuple struct `Z1` defined here + | ------------- similarly named tuple struct `Z1` defined here | help: use this syntax instead | @@ -38,9 +38,9 @@ LL | Z0(x) => {} ::: $DIR/auxiliary/declarations-for-tuple-field-count-errors.rs:1:1 | LL | pub struct Z0; - | -------------- `Z0` defined here + | ------------- `Z0` defined here LL | pub struct Z1(); - | ---------------- similarly named tuple struct `Z1` defined here + | ------------- similarly named tuple struct `Z1` defined here | help: use this syntax instead | @@ -126,7 +126,7 @@ LL | Z1(x) => {} ::: $DIR/auxiliary/declarations-for-tuple-field-count-errors.rs:2:1 | LL | pub struct Z1(); - | ---------------- tuple struct has 0 fields + | ------------- tuple struct has 0 fields error[E0023]: this pattern has 0 fields, but the corresponding tuple struct has 3 fields --> $DIR/pat-tuple-field-count-cross.rs:18:9 diff --git a/src/test/ui/pattern/pat-tuple-overfield.stderr b/src/test/ui/pattern/pat-tuple-overfield.stderr index 1c44f7e5f6f..9e13a2dc9fb 100644 --- a/src/test/ui/pattern/pat-tuple-overfield.stderr +++ b/src/test/ui/pattern/pat-tuple-overfield.stderr @@ -271,7 +271,7 @@ error[E0023]: this pattern has 1 field, but the corresponding tuple struct has 0 --> $DIR/pat-tuple-overfield.rs:59:12 | LL | struct Z1(); - | ------------ tuple struct has 0 fields + | --------- tuple struct has 0 fields ... LL | Z1(_) => {} | ^ expected 0 fields, found 1 @@ -280,7 +280,7 @@ error[E0023]: this pattern has 2 fields, but the corresponding tuple struct has --> $DIR/pat-tuple-overfield.rs:60:12 | LL | struct Z1(); - | ------------ tuple struct has 0 fields + | --------- tuple struct has 0 fields ... LL | Z1(_, _) => {} | ^ ^ expected 0 fields, found 2 diff --git a/src/test/ui/pattern/usefulness/doc-hidden-non-exhaustive.stderr b/src/test/ui/pattern/usefulness/doc-hidden-non-exhaustive.stderr index 296465eb818..643e734f9d4 100644 --- a/src/test/ui/pattern/usefulness/doc-hidden-non-exhaustive.stderr +++ b/src/test/ui/pattern/usefulness/doc-hidden-non-exhaustive.stderr @@ -7,13 +7,8 @@ LL | match HiddenEnum::A { note: `HiddenEnum` defined here --> $DIR/auxiliary/hidden.rs:1:1 | -LL | / pub enum HiddenEnum { -LL | | A, -LL | | B, -LL | | #[doc(hidden)] -LL | | C, -LL | | } - | |_^ +LL | pub enum HiddenEnum { + | ^^^^^^^^^^^^^^^^^^^ = note: the matched value is of type `HiddenEnum` help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern or an explicit pattern as shown | @@ -30,14 +25,11 @@ LL | match HiddenEnum::A { note: `HiddenEnum` defined here --> $DIR/auxiliary/hidden.rs:3:5 | -LL | / pub enum HiddenEnum { -LL | | A, -LL | | B, - | | ^ not covered -LL | | #[doc(hidden)] -LL | | C, -LL | | } - | |_- +LL | pub enum HiddenEnum { + | ------------------- +LL | A, +LL | B, + | ^ not covered = note: the matched value is of type `HiddenEnum` help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern or an explicit pattern as shown | @@ -54,14 +46,11 @@ LL | match HiddenEnum::A { note: `HiddenEnum` defined here --> $DIR/auxiliary/hidden.rs:3:5 | -LL | / pub enum HiddenEnum { -LL | | A, -LL | | B, - | | ^ not covered -LL | | #[doc(hidden)] -LL | | C, -LL | | } - | |_- +LL | pub enum HiddenEnum { + | ------------------- +LL | A, +LL | B, + | ^ not covered = note: the matched value is of type `HiddenEnum` help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern, a match arm with multiple or-patterns as shown, or multiple match arms | @@ -78,15 +67,11 @@ LL | match None { note: `Option<HiddenEnum>` defined here --> $SRC_DIR/core/src/option.rs:LL:COL | -LL | / pub enum Option<T> { -LL | | /// No value. -LL | | #[lang = "None"] -LL | | #[stable(feature = "rust1", since = "1.0.0")] -... | -LL | | Some(#[stable(feature = "rust1", since = "1.0.0")] T), - | | ^^^^ not covered -LL | | } - | |_- +LL | pub enum Option<T> { + | ------------------ +... +LL | Some(#[stable(feature = "rust1", since = "1.0.0")] T), + | ^^^^ not covered = note: the matched value is of type `Option<HiddenEnum>` help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern, a match arm with multiple or-patterns as shown, or multiple match arms | diff --git a/src/test/ui/pattern/usefulness/issue-35609.stderr b/src/test/ui/pattern/usefulness/issue-35609.stderr index 717bb53c327..2247b818d43 100644 --- a/src/test/ui/pattern/usefulness/issue-35609.stderr +++ b/src/test/ui/pattern/usefulness/issue-35609.stderr @@ -108,14 +108,8 @@ LL | match Some(A) { note: `Option<Enum>` defined here --> $SRC_DIR/core/src/option.rs:LL:COL | -LL | / pub enum Option<T> { -LL | | /// No value. -LL | | #[lang = "None"] -LL | | #[stable(feature = "rust1", since = "1.0.0")] -... | -LL | | Some(#[stable(feature = "rust1", since = "1.0.0")] T), -LL | | } - | |_^ +LL | pub enum Option<T> { + | ^^^^^^^^^^^^^^^^^^ = note: the matched value is of type `Option<Enum>` help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern as shown, or multiple match arms | diff --git a/src/test/ui/pattern/usefulness/issue-3601.stderr b/src/test/ui/pattern/usefulness/issue-3601.stderr index 4e0adcc1ba2..eb8c63919b6 100644 --- a/src/test/ui/pattern/usefulness/issue-3601.stderr +++ b/src/test/ui/pattern/usefulness/issue-3601.stderr @@ -11,7 +11,7 @@ LL | / pub struct Box< LL | | T: ?Sized, LL | | #[unstable(feature = "allocator_api", issue = "32838")] A: Allocator = Global, LL | | >(Unique<T>, A); - | |________________^ + | |_^ = note: the matched value is of type `Box<ElementKind>` help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern or an explicit pattern as shown | diff --git a/src/test/ui/pattern/usefulness/match-arm-statics-2.stderr b/src/test/ui/pattern/usefulness/match-arm-statics-2.stderr index 3326e6b85a4..a2b66f5ed67 100644 --- a/src/test/ui/pattern/usefulness/match-arm-statics-2.stderr +++ b/src/test/ui/pattern/usefulness/match-arm-statics-2.stderr @@ -20,18 +20,14 @@ LL | match Some(Some(North)) { note: `Option<Option<Direction>>` defined here --> $SRC_DIR/core/src/option.rs:LL:COL | -LL | / pub enum Option<T> { -LL | | /// No value. -LL | | #[lang = "None"] -LL | | #[stable(feature = "rust1", since = "1.0.0")] -... | -LL | | Some(#[stable(feature = "rust1", since = "1.0.0")] T), - | | ^^^^ - | | | - | | not covered - | | not covered -LL | | } - | |_- +LL | pub enum Option<T> { + | ------------------ +... +LL | Some(#[stable(feature = "rust1", since = "1.0.0")] T), + | ^^^^ + | | + | not covered + | not covered = note: the matched value is of type `Option<Option<Direction>>` help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern or an explicit pattern as shown | diff --git a/src/test/ui/pattern/usefulness/match-privately-empty.stderr b/src/test/ui/pattern/usefulness/match-privately-empty.stderr index 88178d64291..4607cfaae17 100644 --- a/src/test/ui/pattern/usefulness/match-privately-empty.stderr +++ b/src/test/ui/pattern/usefulness/match-privately-empty.stderr @@ -7,15 +7,11 @@ LL | match private::DATA { note: `Option<Private>` defined here --> $SRC_DIR/core/src/option.rs:LL:COL | -LL | / pub enum Option<T> { -LL | | /// No value. -LL | | #[lang = "None"] -LL | | #[stable(feature = "rust1", since = "1.0.0")] -... | -LL | | Some(#[stable(feature = "rust1", since = "1.0.0")] T), - | | ^^^^ not covered -LL | | } - | |_- +LL | pub enum Option<T> { + | ------------------ +... +LL | Some(#[stable(feature = "rust1", since = "1.0.0")] T), + | ^^^^ not covered = note: the matched value is of type `Option<Private>` help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern or an explicit pattern as shown | diff --git a/src/test/ui/pattern/usefulness/non-exhaustive-match.stderr b/src/test/ui/pattern/usefulness/non-exhaustive-match.stderr index 89b4e06efda..f2362c316df 100644 --- a/src/test/ui/pattern/usefulness/non-exhaustive-match.stderr +++ b/src/test/ui/pattern/usefulness/non-exhaustive-match.stderr @@ -37,15 +37,11 @@ LL | match Some(10) { note: `Option<i32>` defined here --> $SRC_DIR/core/src/option.rs:LL:COL | -LL | / pub enum Option<T> { -LL | | /// No value. -LL | | #[lang = "None"] -LL | | #[stable(feature = "rust1", since = "1.0.0")] -... | -LL | | Some(#[stable(feature = "rust1", since = "1.0.0")] T), - | | ^^^^ not covered -LL | | } - | |_- +LL | pub enum Option<T> { + | ------------------ +... +LL | Some(#[stable(feature = "rust1", since = "1.0.0")] T), + | ^^^^ not covered = note: the matched value is of type `Option<i32>` help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern or an explicit pattern as shown | diff --git a/src/test/ui/pattern/usefulness/stable-gated-patterns.stderr b/src/test/ui/pattern/usefulness/stable-gated-patterns.stderr index 559539178cb..98c75953add 100644 --- a/src/test/ui/pattern/usefulness/stable-gated-patterns.stderr +++ b/src/test/ui/pattern/usefulness/stable-gated-patterns.stderr @@ -7,16 +7,11 @@ LL | match UnstableEnum::Stable { note: `UnstableEnum` defined here --> $DIR/auxiliary/unstable.rs:9:5 | -LL | / pub enum UnstableEnum { -LL | | #[stable(feature = "stable_test_feature", since = "1.0.0")] -LL | | Stable, -LL | | #[stable(feature = "stable_test_feature", since = "1.0.0")] -LL | | Stable2, - | | ^^^^^^^ not covered -LL | | #[unstable(feature = "unstable_test_feature", issue = "none")] -LL | | Unstable, -LL | | } - | |_- +LL | pub enum UnstableEnum { + | --------------------- +... +LL | Stable2, + | ^^^^^^^ not covered = note: the matched value is of type `UnstableEnum` help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern, a match arm with multiple or-patterns as shown, or multiple match arms | @@ -33,14 +28,8 @@ LL | match UnstableEnum::Stable { note: `UnstableEnum` defined here --> $DIR/auxiliary/unstable.rs:5:1 | -LL | / pub enum UnstableEnum { -LL | | #[stable(feature = "stable_test_feature", since = "1.0.0")] -LL | | Stable, -LL | | #[stable(feature = "stable_test_feature", since = "1.0.0")] -... | -LL | | Unstable, -LL | | } - | |_^ +LL | pub enum UnstableEnum { + | ^^^^^^^^^^^^^^^^^^^^^ = note: the matched value is of type `UnstableEnum` help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern or an explicit pattern as shown | diff --git a/src/test/ui/pattern/usefulness/unstable-gated-patterns.stderr b/src/test/ui/pattern/usefulness/unstable-gated-patterns.stderr index b5f1805deef..f07a25ca89b 100644 --- a/src/test/ui/pattern/usefulness/unstable-gated-patterns.stderr +++ b/src/test/ui/pattern/usefulness/unstable-gated-patterns.stderr @@ -7,15 +7,11 @@ LL | match UnstableEnum::Stable { note: `UnstableEnum` defined here --> $DIR/auxiliary/unstable.rs:11:5 | -LL | / pub enum UnstableEnum { -LL | | #[stable(feature = "stable_test_feature", since = "1.0.0")] -LL | | Stable, -LL | | #[stable(feature = "stable_test_feature", since = "1.0.0")] -... | -LL | | Unstable, - | | ^^^^^^^^ not covered -LL | | } - | |_- +LL | pub enum UnstableEnum { + | --------------------- +... +LL | Unstable, + | ^^^^^^^^ not covered = note: the matched value is of type `UnstableEnum` help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern or an explicit pattern as shown | |
