diff options
| author | Michael Goulet <michael@errs.io> | 2021-11-19 14:57:33 -0800 |
|---|---|---|
| committer | Michael Goulet <michael@errs.io> | 2021-11-20 17:26:18 -0800 |
| commit | 01b24045faebc1d0d9f42f355e536df6fc693e49 (patch) | |
| tree | 19fdae58904369e1f3e89d5ffbfd752165370c39 /src | |
| parent | 3ba27e7dfa69b5a9e1b8c5ff8868ed822dcff344 (diff) | |
Fix for issue 91058
Diffstat (limited to 'src')
5 files changed, 22 insertions, 20 deletions
diff --git a/src/test/ui/half-open-range-patterns/exclusive_range_pattern_syntax_collision.stderr b/src/test/ui/half-open-range-patterns/exclusive_range_pattern_syntax_collision.stderr index 1df7fd59f57..a6f8563a047 100644 --- a/src/test/ui/half-open-range-patterns/exclusive_range_pattern_syntax_collision.stderr +++ b/src/test/ui/half-open-range-patterns/exclusive_range_pattern_syntax_collision.stderr @@ -8,10 +8,6 @@ LL | [_, 99.., _] => {}, | = note: expected struct `std::ops::Range<{integer}>` found type `{integer}` -help: you might have meant to use field `start` whose type is `{integer}` - | -LL | match [5..4, 99..105, 43..44].start { - | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ error: aborting due to previous error diff --git a/src/test/ui/half-open-range-patterns/exclusive_range_pattern_syntax_collision2.stderr b/src/test/ui/half-open-range-patterns/exclusive_range_pattern_syntax_collision2.stderr index 87484c1072d..4e0102c930d 100644 --- a/src/test/ui/half-open-range-patterns/exclusive_range_pattern_syntax_collision2.stderr +++ b/src/test/ui/half-open-range-patterns/exclusive_range_pattern_syntax_collision2.stderr @@ -14,10 +14,6 @@ LL | [_, 99..] => {}, | = note: expected struct `std::ops::Range<{integer}>` found type `{integer}` -help: you might have meant to use field `start` whose type is `{integer}` - | -LL | match [5..4, 99..105, 43..44].start { - | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ error: aborting due to 2 previous errors diff --git a/src/test/ui/half-open-range-patterns/exclusive_range_pattern_syntax_collision3.stderr b/src/test/ui/half-open-range-patterns/exclusive_range_pattern_syntax_collision3.stderr index c48f6cce93c..665eef2fcb9 100644 --- a/src/test/ui/half-open-range-patterns/exclusive_range_pattern_syntax_collision3.stderr +++ b/src/test/ui/half-open-range-patterns/exclusive_range_pattern_syntax_collision3.stderr @@ -8,10 +8,6 @@ LL | [..9, 99..100, _] => {}, | = note: expected struct `std::ops::Range<{integer}>` found type `{integer}` -help: you might have meant to use field `start` whose type is `{integer}` - | -LL | match [5..4, 99..105, 43..44].start { - | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ error[E0308]: mismatched types --> $DIR/exclusive_range_pattern_syntax_collision3.rs:6:15 @@ -25,10 +21,6 @@ LL | [..9, 99..100, _] => {}, | = note: expected struct `std::ops::Range<{integer}>` found type `{integer}` -help: you might have meant to use field `start` whose type is `{integer}` - | -LL | match [5..4, 99..105, 43..44].start { - | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ error[E0308]: mismatched types --> $DIR/exclusive_range_pattern_syntax_collision3.rs:6:19 @@ -42,10 +34,6 @@ LL | [..9, 99..100, _] => {}, | = note: expected struct `std::ops::Range<{integer}>` found type `{integer}` -help: you might have meant to use field `start` whose type is `{integer}` - | -LL | match [5..4, 99..105, 43..44].start { - | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ error: aborting due to 3 previous errors diff --git a/src/test/ui/match/issue-91058.rs b/src/test/ui/match/issue-91058.rs new file mode 100644 index 00000000000..4845937d544 --- /dev/null +++ b/src/test/ui/match/issue-91058.rs @@ -0,0 +1,11 @@ +struct S(()); + +fn main() { + let array = [S(())]; + + match array { + [()] => {} + //~^ ERROR mismatched types [E0308] + _ => {} + } +} diff --git a/src/test/ui/match/issue-91058.stderr b/src/test/ui/match/issue-91058.stderr new file mode 100644 index 00000000000..ec1d7e21fa5 --- /dev/null +++ b/src/test/ui/match/issue-91058.stderr @@ -0,0 +1,11 @@ +error[E0308]: mismatched types + --> $DIR/issue-91058.rs:7:10 + | +LL | match array { + | ----- this expression has type `[S; 1]` +LL | [()] => {} + | ^^ expected struct `S`, found `()` + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0308`. |
