Fix for issue 91058

This commit is contained in:
Michael Goulet 2021-11-19 14:57:33 -08:00
parent 3ba27e7dfa
commit 01b24045fa
6 changed files with 38 additions and 24 deletions

View file

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

View file

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

View file

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

View file

@ -0,0 +1,11 @@
struct S(());
fn main() {
let array = [S(())];
match array {
[()] => {}
//~^ ERROR mismatched types [E0308]
_ => {}
}
}

View file

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