diff options
| author | Michael Goulet <michael@errs.io> | 2025-02-20 23:05:38 +0000 |
|---|---|---|
| committer | Michael Goulet <michael@errs.io> | 2025-02-21 00:41:17 +0000 |
| commit | 0a7ab1d6df4a2cfac819b0bada85b9142ac8ba26 (patch) | |
| tree | 40adab0be475b174d0fa8d3041089a10f5b1b440 /tests/ui/pattern/usefulness | |
| parent | 28b83ee59698ae069f5355b8e03f976406f410f5 (diff) | |
| download | rust-0a7ab1d6df4a2cfac819b0bada85b9142ac8ba26.tar.gz rust-0a7ab1d6df4a2cfac819b0bada85b9142ac8ba26.zip | |
More sophisticated span trimming
Diffstat (limited to 'tests/ui/pattern/usefulness')
| -rw-r--r-- | tests/ui/pattern/usefulness/unstable-gated-fields.stderr | 30 |
1 files changed, 12 insertions, 18 deletions
diff --git a/tests/ui/pattern/usefulness/unstable-gated-fields.stderr b/tests/ui/pattern/usefulness/unstable-gated-fields.stderr index 4487f273534..bd51aca65ee 100644 --- a/tests/ui/pattern/usefulness/unstable-gated-fields.stderr +++ b/tests/ui/pattern/usefulness/unstable-gated-fields.stderr @@ -6,19 +6,16 @@ LL | let UnstableStruct { stable, stable2, } = UnstableStruct::default(); | help: include the missing field in the pattern | -LL - let UnstableStruct { stable, stable2, } = UnstableStruct::default(); -LL + let UnstableStruct { stable, stable2, unstable } = UnstableStruct::default(); - | +LL | let UnstableStruct { stable, stable2, unstable } = UnstableStruct::default(); + | ++++++++ help: if you don't care about this missing field, you can explicitly ignore it | -LL - let UnstableStruct { stable, stable2, } = UnstableStruct::default(); -LL + let UnstableStruct { stable, stable2, unstable: _ } = UnstableStruct::default(); - | +LL | let UnstableStruct { stable, stable2, unstable: _ } = UnstableStruct::default(); + | +++++++++++ help: or always ignore missing fields here | -LL - let UnstableStruct { stable, stable2, } = UnstableStruct::default(); -LL + let UnstableStruct { stable, stable2, .. } = UnstableStruct::default(); - | +LL | let UnstableStruct { stable, stable2, .. } = UnstableStruct::default(); + | ++ error[E0027]: pattern does not mention field `stable2` --> $DIR/unstable-gated-fields.rs:13:9 @@ -28,19 +25,16 @@ LL | let UnstableStruct { stable, unstable, } = UnstableStruct::default(); | help: include the missing field in the pattern | -LL - let UnstableStruct { stable, unstable, } = UnstableStruct::default(); -LL + let UnstableStruct { stable, unstable, stable2 } = UnstableStruct::default(); - | +LL | let UnstableStruct { stable, unstable, stable2 } = UnstableStruct::default(); + | +++++++ help: if you don't care about this missing field, you can explicitly ignore it | -LL - let UnstableStruct { stable, unstable, } = UnstableStruct::default(); -LL + let UnstableStruct { stable, unstable, stable2: _ } = UnstableStruct::default(); - | +LL | let UnstableStruct { stable, unstable, stable2: _ } = UnstableStruct::default(); + | ++++++++++ help: or always ignore missing fields here | -LL - let UnstableStruct { stable, unstable, } = UnstableStruct::default(); -LL + let UnstableStruct { stable, unstable, .. } = UnstableStruct::default(); - | +LL | let UnstableStruct { stable, unstable, .. } = UnstableStruct::default(); + | ++ error: aborting due to 2 previous errors |
