summary refs log tree commit diff
path: root/tests/ui/pattern/rfc-3627-match-ergonomics-2024/migration_lint.stderr
blob: 83346b9dd4a84ed631b0008bebdaff95c1017646 (plain)
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
error: this pattern relies on behavior which may change in edition 2024
  --> $DIR/migration_lint.rs:25:13
   |
LL |     let Foo(mut x) = &Foo(0);
   |             ^^^ requires binding by-value, but the implicit default is by-reference
   |
   = warning: this changes meaning in Rust 2024
   = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/match-ergonomics.html>
note: the lint level is defined here
  --> $DIR/migration_lint.rs:7:9
   |
LL | #![deny(rust_2024_incompatible_pat)]
   |         ^^^^^^^^^^^^^^^^^^^^^^^^^^
help: make the implied reference pattern explicit
   |
LL |     let &Foo(mut x) = &Foo(0);
   |         +

error: this pattern relies on behavior which may change in edition 2024
  --> $DIR/migration_lint.rs:30:13
   |
LL |     let Foo(mut x) = &mut Foo(0);
   |             ^^^ requires binding by-value, but the implicit default is by-reference
   |
   = warning: this changes meaning in Rust 2024
   = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/match-ergonomics.html>
help: make the implied reference pattern explicit
   |
LL |     let &mut Foo(mut x) = &mut Foo(0);
   |         ++++

error: this pattern relies on behavior which may change in edition 2024
  --> $DIR/migration_lint.rs:35:13
   |
LL |     let Foo(ref x) = &Foo(0);
   |             ^^^ cannot override to bind by-reference when that is the implicit default
   |
   = warning: this changes meaning in Rust 2024
   = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/match-ergonomics.html>
help: make the implied reference pattern explicit
   |
LL |     let &Foo(ref x) = &Foo(0);
   |         +

error: this pattern relies on behavior which may change in edition 2024
  --> $DIR/migration_lint.rs:40:13
   |
LL |     let Foo(ref x) = &mut Foo(0);
   |             ^^^ cannot override to bind by-reference when that is the implicit default
   |
   = warning: this changes meaning in Rust 2024
   = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/match-ergonomics.html>
help: make the implied reference pattern explicit
   |
LL |     let &mut Foo(ref x) = &mut Foo(0);
   |         ++++

error: this pattern relies on behavior which may change in edition 2024
  --> $DIR/migration_lint.rs:57:13
   |
LL |     let Foo(&x) = &Foo(&0);
   |             ^ cannot implicitly match against multiple layers of reference
   |
   = warning: this changes meaning in Rust 2024
   = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/match-ergonomics.html>
help: make the implied reference pattern explicit
   |
LL |     let &Foo(&x) = &Foo(&0);
   |         +

error: this pattern relies on behavior which may change in edition 2024
  --> $DIR/migration_lint.rs:62:13
   |
LL |     let Foo(&mut x) = &Foo(&mut 0);
   |             ^^^^ cannot implicitly match against multiple layers of reference
   |
   = warning: this changes meaning in Rust 2024
   = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/match-ergonomics.html>
help: make the implied reference pattern explicit
   |
LL |     let &Foo(&mut x) = &Foo(&mut 0);
   |         +

error: this pattern relies on behavior which may change in edition 2024
  --> $DIR/migration_lint.rs:67:13
   |
LL |     let Foo(&x) = &mut Foo(&0);
   |             ^ cannot implicitly match against multiple layers of reference
   |
   = warning: this changes meaning in Rust 2024
   = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/match-ergonomics.html>
help: make the implied reference pattern explicit
   |
LL |     let &mut Foo(&x) = &mut Foo(&0);
   |         ++++

error: this pattern relies on behavior which may change in edition 2024
  --> $DIR/migration_lint.rs:72:13
   |
LL |     let Foo(&mut x) = &mut Foo(&mut 0);
   |             ^^^^ cannot implicitly match against multiple layers of reference
   |
   = warning: this changes meaning in Rust 2024
   = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/match-ergonomics.html>
help: make the implied reference pattern explicit
   |
LL |     let &mut Foo(&mut x) = &mut Foo(&mut 0);
   |         ++++

error: this pattern relies on behavior which may change in edition 2024
  --> $DIR/migration_lint.rs:81:17
   |
LL |     if let Some(&x) = &&&&&Some(&0u8) {
   |                 ^ cannot implicitly match against multiple layers of reference
   |
   = warning: this changes meaning in Rust 2024
   = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/match-ergonomics.html>
help: make the implied reference patterns explicit
   |
LL |     if let &&&&&Some(&x) = &&&&&Some(&0u8) {
   |            +++++

error: this pattern relies on behavior which may change in edition 2024
  --> $DIR/migration_lint.rs:87:17
   |
LL |     if let Some(&mut x) = &&&&&Some(&mut 0u8) {
   |                 ^^^^ cannot implicitly match against multiple layers of reference
   |
   = warning: this changes meaning in Rust 2024
   = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/match-ergonomics.html>
help: make the implied reference patterns explicit
   |
LL |     if let &&&&&Some(&mut x) = &&&&&Some(&mut 0u8) {
   |            +++++

error: this pattern relies on behavior which may change in edition 2024
  --> $DIR/migration_lint.rs:93:17
   |
LL |     if let Some(&x) = &&&&&mut Some(&0u8) {
   |                 ^ cannot implicitly match against multiple layers of reference
   |
   = warning: this changes meaning in Rust 2024
   = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/match-ergonomics.html>
help: make the implied reference patterns explicit
   |
LL |     if let &&&&&mut Some(&x) = &&&&&mut Some(&0u8) {
   |            ++++++++

error: this pattern relies on behavior which may change in edition 2024
  --> $DIR/migration_lint.rs:99:17
   |
LL |     if let Some(&mut Some(Some(x))) = &mut Some(&mut Some(&mut Some(0u8))) {
   |                 ^^^^ cannot implicitly match against multiple layers of reference
   |
   = warning: this changes meaning in Rust 2024
   = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/match-ergonomics.html>
help: make the implied reference patterns and variable binding mode explicit
   |
LL |     if let &mut Some(&mut Some(&mut Some(ref mut x))) = &mut Some(&mut Some(&mut Some(0u8))) {
   |            ++++                ++++      +++++++

error: this pattern relies on behavior which may change in edition 2024
  --> $DIR/migration_lint.rs:111:21
   |
LL |     let Struct { a, mut b, c } = &Struct { a: 0, b: 0, c: 0 };
   |                     ^^^ requires binding by-value, but the implicit default is by-reference
   |
   = warning: this changes meaning in Rust 2024
   = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/match-ergonomics.html>
help: make the implied reference pattern and variable binding modes explicit
   |
LL |     let &Struct { ref a, mut b, ref c } = &Struct { a: 0, b: 0, c: 0 };
   |         +         +++           +++

error: this pattern relies on behavior which may change in edition 2024
  --> $DIR/migration_lint.rs:117:21
   |
LL |     let Struct { a: &a, b, ref c } = &Struct { a: &0, b: &0, c: &0 };
   |                     ^      ^^^ cannot override to bind by-reference when that is the implicit default
   |                     |
   |                     cannot implicitly match against multiple layers of reference
   |
   = warning: this changes meaning in Rust 2024
   = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/match-ergonomics.html>
help: make the implied reference pattern and variable binding mode explicit
   |
LL |     let &Struct { a: &a, ref b, ref c } = &Struct { a: &0, b: &0, c: &0 };
   |         +                +++

error: this pattern relies on behavior which may change in edition 2024
  --> $DIR/migration_lint.rs:124:24
   |
LL |     if let Struct { a: &Some(a), b: Some(&b), c: Some(c) } =
   |                        ^                 ^ cannot implicitly match against multiple layers of reference
   |                        |
   |                        cannot implicitly match against multiple layers of reference
   |
   = warning: this changes meaning in Rust 2024
   = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/match-ergonomics.html>
help: make the implied reference patterns and variable binding mode explicit
   |
LL |     if let &Struct { a: &Some(a), b: &Some(&b), c: &Some(ref c) } =
   |            +                         +             +     +++

error: this pattern relies on behavior which may change in edition 2024
  --> $DIR/migration_lint.rs:137:15
   |
LL |         (Some(mut x), migration_lint_macros::mixed_edition_pat!(y)) => {
   |               ^^^     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ default binding mode is reset within expansion
   |               |
   |               requires binding by-value, but the implicit default is by-reference
   |
   = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/match-ergonomics.html>
   = note: this error originates in the macro `migration_lint_macros::mixed_edition_pat` (in Nightly builds, run with -Z macro-backtrace for more info)
help: make the implied reference pattern explicit
   |
LL |         &(Some(mut x), migration_lint_macros::mixed_edition_pat!(y)) => {
   |         +

error: aborting due to 16 previous errors