diff options
4 files changed, 26 insertions, 59 deletions
diff --git a/tests/ui/pattern/rfc-3627-match-ergonomics-2024/experimental/pattern-errors.classic2024.stderr b/tests/ui/pattern/rfc-3627-match-ergonomics-2024/experimental/pattern-errors.classic2024.stderr index 45ee489c520..cc39e9b8ab7 100644 --- a/tests/ui/pattern/rfc-3627-match-ergonomics-2024/experimental/pattern-errors.classic2024.stderr +++ b/tests/ui/pattern/rfc-3627-match-ergonomics-2024/experimental/pattern-errors.classic2024.stderr @@ -71,19 +71,7 @@ LL | if let Some(&Some(x)) = &Some(Some(0)) { | ~ error[E0308]: mismatched types - --> $DIR/pattern-errors.rs:38:17 - | -LL | if let Some(&mut Some(x)) = &Some(Some(0)) { - | ^^^^^ - | - = note: cannot match inherited `&` with `&mut` pattern -help: replace this `&mut` pattern with `&` - | -LL | if let Some(&Some(x)) = &Some(Some(0)) { - | ~ - -error[E0308]: mismatched types - --> $DIR/pattern-errors.rs:118:10 + --> $DIR/pattern-errors.rs:115:10 | LL | let [&mut x] = &[&mut 0]; | ^^^^^ @@ -95,7 +83,7 @@ LL | let [&x] = &[&mut 0]; | ~ error[E0308]: mismatched types - --> $DIR/pattern-errors.rs:123:10 + --> $DIR/pattern-errors.rs:120:10 | LL | let [&mut &x] = &[&mut 0]; | ^^^^^ @@ -107,7 +95,7 @@ LL | let [&&x] = &[&mut 0]; | ~ error[E0308]: mismatched types - --> $DIR/pattern-errors.rs:128:10 + --> $DIR/pattern-errors.rs:125:10 | LL | let [&mut &ref x] = &[&mut 0]; | ^^^^^ @@ -119,7 +107,7 @@ LL | let [&&ref x] = &[&mut 0]; | ~ error[E0308]: mismatched types - --> $DIR/pattern-errors.rs:133:10 + --> $DIR/pattern-errors.rs:130:10 | LL | let [&mut &(mut x)] = &[&mut 0]; | ^^^^^ @@ -130,6 +118,6 @@ help: replace this `&mut` pattern with `&` LL | let [&&(mut x)] = &[&mut 0]; | ~ -error: aborting due to 11 previous errors +error: aborting due to 10 previous errors For more information about this error, try `rustc --explain E0308`. diff --git a/tests/ui/pattern/rfc-3627-match-ergonomics-2024/experimental/pattern-errors.rs b/tests/ui/pattern/rfc-3627-match-ergonomics-2024/experimental/pattern-errors.rs index 22ff0708d93..d1f404a634b 100644 --- a/tests/ui/pattern/rfc-3627-match-ergonomics-2024/experimental/pattern-errors.rs +++ b/tests/ui/pattern/rfc-3627-match-ergonomics-2024/experimental/pattern-errors.rs @@ -29,15 +29,12 @@ pub fn main() { if let Some(&Some(&mut _)) = &mut Some(&Some(0)) { //~^ ERROR: mismatched types } - if let Some(&Some(Some((&mut _)))) = &Some(Some(&mut Some(0))) { + if let Some(&Some(Some(&mut _))) = &Some(Some(&mut Some(0))) { //[structural2024]~^ ERROR: mismatched types } if let Some(&mut Some(x)) = &Some(Some(0)) { //~^ ERROR: mismatched types } - if let Some(&mut Some(x)) = &Some(Some(0)) { - //~^ ERROR: mismatched types - } } fn structural_errors_0() { diff --git a/tests/ui/pattern/rfc-3627-match-ergonomics-2024/experimental/pattern-errors.structural2024.stderr b/tests/ui/pattern/rfc-3627-match-ergonomics-2024/experimental/pattern-errors.structural2024.stderr index 3396d414819..b996af4c134 100644 --- a/tests/ui/pattern/rfc-3627-match-ergonomics-2024/experimental/pattern-errors.structural2024.stderr +++ b/tests/ui/pattern/rfc-3627-match-ergonomics-2024/experimental/pattern-errors.structural2024.stderr @@ -35,16 +35,16 @@ LL | if let Some(&Some(&_)) = &mut Some(&Some(0)) { | ~ error[E0308]: mismatched types - --> $DIR/pattern-errors.rs:32:29 + --> $DIR/pattern-errors.rs:32:28 | -LL | if let Some(&Some(Some((&mut _)))) = &Some(Some(&mut Some(0))) { - | ^^^^^ +LL | if let Some(&Some(Some(&mut _))) = &Some(Some(&mut Some(0))) { + | ^^^^^ | = note: cannot match inherited `&` with `&mut` pattern help: replace this `&mut` pattern with `&` | -LL | if let Some(&Some(Some((&_)))) = &Some(Some(&mut Some(0))) { - | ~ +LL | if let Some(&Some(Some(&_))) = &Some(Some(&mut Some(0))) { + | ~ error[E0308]: mismatched types --> $DIR/pattern-errors.rs:35:17 @@ -59,19 +59,7 @@ LL | if let Some(&Some(x)) = &Some(Some(0)) { | ~ error[E0308]: mismatched types - --> $DIR/pattern-errors.rs:38:17 - | -LL | if let Some(&mut Some(x)) = &Some(Some(0)) { - | ^^^^^ - | - = note: cannot match inherited `&` with `&mut` pattern -help: replace this `&mut` pattern with `&` - | -LL | if let Some(&Some(x)) = &Some(Some(0)) { - | ~ - -error[E0308]: mismatched types - --> $DIR/pattern-errors.rs:44:11 + --> $DIR/pattern-errors.rs:41:11 | LL | let &[&mut x] = &&mut [0]; | ^^^^^ @@ -83,7 +71,7 @@ LL | let &[&x] = &&mut [0]; | ~ error[E0308]: mismatched types - --> $DIR/pattern-errors.rs:49:11 + --> $DIR/pattern-errors.rs:46:11 | LL | let &[&mut x] = &mut &mut [0]; | ^^^^^ @@ -95,7 +83,7 @@ LL | let &[&x] = &mut &mut [0]; | ~ error[E0308]: mismatched types - --> $DIR/pattern-errors.rs:54:11 + --> $DIR/pattern-errors.rs:51:11 | LL | let &[&mut ref x] = &&mut [0]; | ^^^^^ @@ -107,7 +95,7 @@ LL | let &[&ref x] = &&mut [0]; | ~ error[E0308]: mismatched types - --> $DIR/pattern-errors.rs:59:11 + --> $DIR/pattern-errors.rs:56:11 | LL | let &[&mut ref x] = &mut &mut [0]; | ^^^^^ @@ -119,7 +107,7 @@ LL | let &[&ref x] = &mut &mut [0]; | ~ error[E0308]: mismatched types - --> $DIR/pattern-errors.rs:64:11 + --> $DIR/pattern-errors.rs:61:11 | LL | let &[&mut mut x] = &&mut [0]; | ^^^^^ @@ -131,7 +119,7 @@ LL | let &[&mut x] = &&mut [0]; | ~ error[E0308]: mismatched types - --> $DIR/pattern-errors.rs:69:11 + --> $DIR/pattern-errors.rs:66:11 | LL | let &[&mut mut x] = &mut &mut [0]; | ^^^^^ @@ -143,7 +131,7 @@ LL | let &[&mut x] = &mut &mut [0]; | ~ error[E0658]: binding cannot be both mutable and by-reference - --> $DIR/pattern-errors.rs:76:12 + --> $DIR/pattern-errors.rs:73:12 | LL | let [&(mut x)] = &[&0]; | ^^^^ @@ -153,7 +141,7 @@ LL | let [&(mut x)] = &[&0]; = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date error[E0658]: binding cannot be both mutable and by-reference - --> $DIR/pattern-errors.rs:80:12 + --> $DIR/pattern-errors.rs:77:12 | LL | let [&(mut x)] = &mut [&0]; | ^^^^ @@ -163,7 +151,7 @@ LL | let [&(mut x)] = &mut [&0]; = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date error[E0308]: mismatched types - --> $DIR/pattern-errors.rs:86:11 + --> $DIR/pattern-errors.rs:83:11 | LL | let [&&mut x] = &[&mut 0]; | ^^^^^ @@ -175,7 +163,7 @@ LL | let [&&x] = &[&mut 0]; | ~ error[E0308]: mismatched types - --> $DIR/pattern-errors.rs:91:11 + --> $DIR/pattern-errors.rs:88:11 | LL | let [&&mut x] = &mut [&mut 0]; | ^^^^^ @@ -187,7 +175,7 @@ LL | let [&&x] = &mut [&mut 0]; | ~ error[E0308]: mismatched types - --> $DIR/pattern-errors.rs:96:11 + --> $DIR/pattern-errors.rs:93:11 | LL | let [&&mut ref x] = &[&mut 0]; | ^^^^^ @@ -199,7 +187,7 @@ LL | let [&&ref x] = &[&mut 0]; | ~ error[E0308]: mismatched types - --> $DIR/pattern-errors.rs:101:11 + --> $DIR/pattern-errors.rs:98:11 | LL | let [&&mut ref x] = &mut [&mut 0]; | ^^^^^ @@ -211,7 +199,7 @@ LL | let [&&ref x] = &mut [&mut 0]; | ~ error[E0308]: mismatched types - --> $DIR/pattern-errors.rs:106:11 + --> $DIR/pattern-errors.rs:103:11 | LL | let [&&mut mut x] = &[&mut 0]; | ^^^^^ @@ -223,7 +211,7 @@ LL | let [&&mut x] = &[&mut 0]; | ~ error[E0308]: mismatched types - --> $DIR/pattern-errors.rs:111:11 + --> $DIR/pattern-errors.rs:108:11 | LL | let [&&mut mut x] = &mut [&mut 0]; | ^^^^^ @@ -234,7 +222,7 @@ help: replace this `&mut` pattern with `&` LL | let [&&mut x] = &mut [&mut 0]; | ~ -error: aborting due to 20 previous errors +error: aborting due to 19 previous errors Some errors have detailed explanations: E0308, E0658. For more information about an error, try `rustc --explain E0308`. diff --git a/tests/ui/pattern/rfc-3627-match-ergonomics-2024/experimental/well-typed-edition-2024.rs b/tests/ui/pattern/rfc-3627-match-ergonomics-2024/experimental/well-typed-edition-2024.rs index 8a2593d0e3a..906110d1dce 100644 --- a/tests/ui/pattern/rfc-3627-match-ergonomics-2024/experimental/well-typed-edition-2024.rs +++ b/tests/ui/pattern/rfc-3627-match-ergonomics-2024/experimental/well-typed-edition-2024.rs @@ -23,9 +23,6 @@ pub fn main() { if let Some(Some(&mut x)) = &mut Some(&mut Some(0)) { let _: u32 = x; } - if let Some(Some(&x)) = &Some(&Some(0)) { - let _: u32 = x; - } if let Some(&Some(&x)) = &mut Some(&Some(0)) { let _: u32 = x; } @@ -41,9 +38,6 @@ pub fn main() { if let Some(&Some(&x)) = &Some(&Some(0)) { let _: u32 = x; } - if let Some(&Some(&x)) = &Some(&mut Some(0)) { - let _: u32 = x; - } if let Some(&Some(Some(&x))) = &Some(Some(&mut Some(0))) { let _: u32 = x; } |
