1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225
|
error[E0308]: mismatched types
--> $DIR/min_match_ergonomics_fail.rs:23: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:25: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:26: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:26: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:28: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:29: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:30: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: reference patterns may only be written when the default binding mode is `move`
--> $DIR/min_match_ergonomics_fail.rs:24:20
|
LL | test_pat_on_type![(&x,): &(&T,)];
| ^ reference pattern not allowed under `ref` default binding mode
|
= note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/match-ergonomics.html>
note: matching on a reference type with a non-reference pattern changes the default binding mode
--> $DIR/min_match_ergonomics_fail.rs:24:19
|
LL | test_pat_on_type![(&x,): &(&T,)];
| ^^^^^ this matches on type `&_`
help: make the implied reference pattern explicit
|
LL | test_pat_on_type![&(&x,): &(&T,)];
| +
error: reference patterns may only be written when the default binding mode is `move`
--> $DIR/min_match_ergonomics_fail.rs:27:20
|
LL | test_pat_on_type![(&mut x,): &(&mut T,)];
| ^^^^ reference pattern not allowed under `ref` default binding mode
|
= note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/match-ergonomics.html>
note: matching on a reference type with a non-reference pattern changes the default binding mode
--> $DIR/min_match_ergonomics_fail.rs:27:19
|
LL | test_pat_on_type![(&mut x,): &(&mut T,)];
| ^^^^^^^^^ this matches on type `&_`
help: make the implied reference pattern explicit
|
LL | test_pat_on_type![&(&mut x,): &(&mut T,)];
| +
error: reference patterns may only be written when the default binding mode is `move`
--> $DIR/min_match_ergonomics_fail.rs:31:28
|
LL | test_pat_on_type![Foo { f: &(x,) }: &Foo];
| ^ reference pattern not allowed under `ref` default binding mode
|
= note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/match-ergonomics.html>
note: matching on a reference type with a non-reference pattern changes the default binding mode
--> $DIR/min_match_ergonomics_fail.rs:31:19
|
LL | test_pat_on_type![Foo { f: &(x,) }: &Foo];
| ^^^^^^^^^^^^^^^^ this matches on type `&_`
help: make the implied reference pattern explicit
|
LL | test_pat_on_type![&Foo { f: &(x,) }: &Foo];
| +
error: binding modifiers may only be written when the default binding mode is `move`
--> $DIR/min_match_ergonomics_fail.rs:32:20
|
LL | test_pat_on_type![(mut x,): &(T,)];
| ^^^ binding modifier not allowed under `ref` default binding mode
|
= note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/match-ergonomics.html>
note: matching on a reference type with a non-reference pattern changes the default binding mode
--> $DIR/min_match_ergonomics_fail.rs:32:19
|
LL | test_pat_on_type![(mut x,): &(T,)];
| ^^^^^^^^ this matches on type `&_`
help: make the implied reference pattern explicit
|
LL | test_pat_on_type![&(mut x,): &(T,)];
| +
error: binding modifiers may only be written when the default binding mode is `move`
--> $DIR/min_match_ergonomics_fail.rs:33:20
|
LL | test_pat_on_type![(ref x,): &(T,)];
| ^^^ binding modifier not allowed under `ref` default binding mode
|
= note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/match-ergonomics.html>
note: matching on a reference type with a non-reference pattern changes the default binding mode
--> $DIR/min_match_ergonomics_fail.rs:33:19
|
LL | test_pat_on_type![(ref x,): &(T,)];
| ^^^^^^^^ this matches on type `&_`
help: remove the unnecessary binding modifier
|
LL - test_pat_on_type![(ref x,): &(T,)];
LL + test_pat_on_type![(x,): &(T,)];
|
error: binding modifiers may only be written when the default binding mode is `move`
--> $DIR/min_match_ergonomics_fail.rs:34:20
|
LL | test_pat_on_type![(ref mut x,): &mut (T,)];
| ^^^^^^^ binding modifier not allowed under `ref mut` default binding mode
|
= note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/match-ergonomics.html>
note: matching on a reference type with a non-reference pattern changes the default binding mode
--> $DIR/min_match_ergonomics_fail.rs:34:19
|
LL | test_pat_on_type![(ref mut x,): &mut (T,)];
| ^^^^^^^^^^^^ this matches on type `&mut _`
help: remove the unnecessary binding modifier
|
LL - test_pat_on_type![(ref mut x,): &mut (T,)];
LL + test_pat_on_type![(x,): &mut (T,)];
|
error: reference patterns may only be written when the default binding mode is `move`
--> $DIR/min_match_ergonomics_fail.rs:43:10
|
LL | (&x,) => x,
| ^ reference pattern not allowed under `ref` default binding mode
|
= note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/match-ergonomics.html>
note: matching on a reference type with a non-reference pattern changes the default binding mode
--> $DIR/min_match_ergonomics_fail.rs:43:9
|
LL | (&x,) => x,
| ^^^^^ this matches on type `&_`
help: make the implied reference pattern explicit
|
LL | &(&x,) => x,
| +
error: aborting due to 13 previous errors
For more information about this error, try `rustc --explain E0308`.
|