os-rust/tests/ui/pattern/rfc-3627-match-ergonomics-2024/min_match_ergonomics_fail.stderr

144 lines
4.6 KiB
Text

error[E0308]: mismatched types
--> $DIR/min_match_ergonomics_fail.rs:27:20
|
LL | test_pat_on_type![(&x,): &(T,)];
| ^^ ----- expected due to this
| |
| expected `T`, found `&_`
|
= note: expected struct `T`
found reference `&_`
help: consider removing `&` from the pattern
|
LL - test_pat_on_type![(&x,): &(T,)];
LL + test_pat_on_type![(x,): &(T,)];
|
error[E0308]: mismatched types
--> $DIR/min_match_ergonomics_fail.rs:29:20
|
LL | test_pat_on_type![(&x,): &(&mut T,)];
| ^^ ---------- expected due to this
| |
| types differ in mutability
|
= note: expected mutable reference `&mut T`
found reference `&_`
help: consider removing `&` from the pattern
|
LL - test_pat_on_type![(&x,): &(&mut T,)];
LL + test_pat_on_type![(x,): &(&mut T,)];
|
error[E0308]: mismatched types
--> $DIR/min_match_ergonomics_fail.rs:30:20
|
LL | test_pat_on_type![(&mut x,): &(&T,)];
| ^^^^^^ ------ expected due to this
| |
| types differ in mutability
|
= note: expected reference `&T`
found mutable reference `&mut _`
note: to declare a mutable binding use: `mut x`
--> $DIR/min_match_ergonomics_fail.rs:30:20
|
LL | test_pat_on_type![(&mut x,): &(&T,)];
| ^^^^^^
help: consider removing `&mut` from the pattern
|
LL - test_pat_on_type![(&mut x,): &(&T,)];
LL + test_pat_on_type![(x,): &(&T,)];
|
error[E0308]: mismatched types
--> $DIR/min_match_ergonomics_fail.rs:32:20
|
LL | test_pat_on_type![(&x,): &&mut &(T,)];
| ^^ ----------- expected due to this
| |
| expected `T`, found `&_`
|
= note: expected struct `T`
found reference `&_`
help: consider removing `&` from the pattern
|
LL - test_pat_on_type![(&x,): &&mut &(T,)];
LL + test_pat_on_type![(x,): &&mut &(T,)];
|
error[E0308]: mismatched types
--> $DIR/min_match_ergonomics_fail.rs:33:29
|
LL | test_pat_on_type![Foo { f: (&x,) }: Foo];
| ^^ --- expected due to this
| |
| expected `u8`, found `&_`
|
= note: expected type `u8`
found reference `&_`
help: consider removing `&` from the pattern
|
LL - test_pat_on_type![Foo { f: (&x,) }: Foo];
LL + test_pat_on_type![Foo { f: (x,) }: Foo];
|
error[E0308]: mismatched types
--> $DIR/min_match_ergonomics_fail.rs:34:29
|
LL | test_pat_on_type![Foo { f: (&x,) }: &mut Foo];
| ^^ -------- expected due to this
| |
| expected `u8`, found `&_`
|
= note: expected type `u8`
found reference `&_`
help: consider removing `&` from the pattern
|
LL - test_pat_on_type![Foo { f: (&x,) }: &mut Foo];
LL + test_pat_on_type![Foo { f: (x,) }: &mut Foo];
|
error: patterns are not allowed to reset the default binding mode in rust 2024
--> $DIR/min_match_ergonomics_fail.rs:28:19
|
LL | test_pat_on_type![(&x,): &(&T,)];
| -^^^^
| |
| help: desugar the match ergonomics: `&`
error: patterns are not allowed to reset the default binding mode in rust 2024
--> $DIR/min_match_ergonomics_fail.rs:31:19
|
LL | test_pat_on_type![(&mut x,): &(&mut T,)];
| -^^^^^^^^
| |
| help: desugar the match ergonomics: `&`
error: patterns are not allowed to reset the default binding mode in rust 2024
--> $DIR/min_match_ergonomics_fail.rs:35:19
|
LL | test_pat_on_type![Foo { f: &(x,) }: &Foo];
| -^^^^^^^^^^^^^^^
| |
| help: desugar the match ergonomics: `&`
error: patterns are not allowed to reset the default binding mode in rust 2024
--> $DIR/min_match_ergonomics_fail.rs:36:19
|
LL | test_pat_on_type![(mut x,): &(T,)];
| -^^^^^^^
| |
| help: desugar the match ergonomics: `&`
error: patterns are not allowed to reset the default binding mode in rust 2024
--> $DIR/min_match_ergonomics_fail.rs:47:9
|
LL | (&x,) => x,
| -^^^^
| |
| help: desugar the match ergonomics: `&`
error: aborting due to 11 previous errors
For more information about this error, try `rustc --explain E0308`.