Skip to content

Commit a5f7a34

Browse files
tweak message wording
1 parent bf4ff2c commit a5f7a34

File tree

3 files changed

+17
-17
lines changed

3 files changed

+17
-17
lines changed

compiler/rustc_mir_transform/messages.ftl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ mir_transform_tail_expr_drop_order = relative drop order changing in Rust 2024
4343
mir_transform_tail_expr_dtor = `{$name}` invokes this custom destructor
4444
4545
mir_transform_tail_expr_local = {$is_generated_name ->
46-
[true] this calls a custom destructor and let us call it `{$name}`
46+
[true] this value will be stored in a temporary; let us call it `{$name}`
4747
*[false] `{$name}` calls a custom destructor
4848
}
4949

tests/ui/drop/lint-tail-expr-drop-order.rs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ fn should_lint() -> i32 {
4141
// Should lint
4242
x.get() + LoudDropper.get()
4343
//~^ ERROR: relative drop order changing in Rust 2024
44-
//~| NOTE: this calls a custom destructor and let us call it `#1`
44+
//~| NOTE: this value will be stored in a temporary; let us call it `#1`
4545
//~| NOTE: up until Edition 2021 `#1` is dropped last but will be dropped earlier in Edition 2024
4646
//~| WARN: this changes meaning in Rust 2024
4747
//~| NOTE: most of the time, changing drop order is harmless; inspect the `impl Drop`s for side effects
@@ -66,7 +66,7 @@ fn should_lint_in_nested_items() {
6666
// Should lint
6767
x.get() + LoudDropper.get()
6868
//~^ ERROR: relative drop order changing in Rust 2024
69-
//~| NOTE: this calls a custom destructor and let us call it `#1`
69+
//~| NOTE: this value will be stored in a temporary; let us call it `#1`
7070
//~| NOTE: up until Edition 2021 `#1` is dropped last but will be dropped earlier in Edition 2024
7171
//~| WARN: this changes meaning in Rust 2024
7272
//~| NOTE: most of the time, changing drop order is harmless; inspect the `impl Drop`s for side effects
@@ -93,7 +93,7 @@ fn should_lint_in_nested_block() -> i32 {
9393
//~| NOTE: `x` will be dropped later since Edition 2024
9494
{ LoudDropper.get() }
9595
//~^ ERROR: relative drop order changing in Rust 2024
96-
//~| NOTE: this calls a custom destructor and let us call it `#1`
96+
//~| NOTE: this value will be stored in a temporary; let us call it `#1`
9797
//~| NOTE: up until Edition 2021 `#1` is dropped last but will be dropped earlier in Edition 2024
9898
//~| WARN: this changes meaning in Rust 2024
9999
//~| NOTE: most of the time, changing drop order is harmless; inspect the `impl Drop`s for side effects
@@ -147,7 +147,7 @@ fn should_lint_into_async_body() -> i32 {
147147
LoudDropper.get()
148148
//~^ ERROR: relative drop order changing in Rust 2024
149149
//~| WARN: this changes meaning in Rust 2024
150-
//~| NOTE: this calls a custom destructor and let us call it `#1`
150+
//~| NOTE: this value will be stored in a temporary; let us call it `#1`
151151
//~| NOTE: up until Edition 2021 `#1` is dropped last but will be dropped earlier in Edition 2024
152152
//~| NOTE: most of the time, changing drop order is harmless; inspect the `impl Drop`s for side effects
153153
//~| NOTE: for more information, see issue #123739
@@ -164,7 +164,7 @@ fn should_lint_generics<T: Default>() -> &'static str {
164164
extract(&T::default())
165165
//~^ ERROR: relative drop order changing in Rust 2024
166166
//~| WARN: this changes meaning in Rust 2024
167-
//~| NOTE: this calls a custom destructor and let us call it `#1`
167+
//~| NOTE: this value will be stored in a temporary; let us call it `#1`
168168
//~| NOTE: up until Edition 2021 `#1` is dropped last but will be dropped earlier in Edition 2024
169169
//~| NOTE: most of the time, changing drop order is harmless; inspect the `impl Drop`s for side effects
170170
//~| NOTE: for more information, see issue #123739
@@ -178,7 +178,7 @@ fn should_lint_adt() -> i32 {
178178
LoudDropper.get()
179179
//~^ ERROR: relative drop order changing in Rust 2024
180180
//~| WARN: this changes meaning in Rust 2024
181-
//~| NOTE: this calls a custom destructor and let us call it `#1`
181+
//~| NOTE: this value will be stored in a temporary; let us call it `#1`
182182
//~| NOTE: up until Edition 2021 `#1` is dropped last but will be dropped earlier in Edition 2024
183183
//~| NOTE: most of the time, changing drop order is harmless; inspect the `impl Drop`s for side effects
184184
//~| NOTE: for more information, see issue #123739
@@ -221,7 +221,7 @@ fn should_lint_with_dtor_span() -> i32 {
221221
//~| NOTE: `x` will be dropped later since Edition 2024
222222
LoudDropper3.get()
223223
//~^ ERROR: relative drop order changing in Rust 2024
224-
//~| NOTE: this calls a custom destructor and let us call it `#1`
224+
//~| NOTE: this value will be stored in a temporary; let us call it `#1`
225225
//~| NOTE: up until Edition 2021 `#1` is dropped last but will be dropped earlier in Edition 2024
226226
//~| WARN: this changes meaning in Rust 2024
227227
//~| NOTE: most of the time, changing drop order is harmless; inspect the `impl Drop`s for side effects
@@ -234,7 +234,7 @@ fn should_lint_with_transient_drops() {
234234
{
235235
LoudDropper.get()
236236
//~^ ERROR: relative drop order changing in Rust 2024
237-
//~| NOTE: this calls a custom destructor and let us call it `#1`
237+
//~| NOTE: this value will be stored in a temporary; let us call it `#1`
238238
//~| NOTE: up until Edition 2021 `#1` is dropped last but will be dropped earlier in Edition 2024
239239
//~| WARN: this changes meaning in Rust 2024
240240
//~| NOTE: most of the time, changing drop order is harmless; inspect the `impl Drop`s for side effects

tests/ui/drop/lint-tail-expr-drop-order.stderr

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ LL | let x = LoudDropper;
1010
LL | x.get() + LoudDropper.get()
1111
| ^^^^^^^^^^^
1212
| |
13-
| this calls a custom destructor and let us call it `#1`
13+
| this value will be stored in a temporary; let us call it `#1`
1414
| up until Edition 2021 `#1` is dropped last but will be dropped earlier in Edition 2024
1515
...
1616
LL | }
@@ -59,7 +59,7 @@ LL | let x = LoudDropper;
5959
LL | x.get() + LoudDropper.get()
6060
| ^^^^^^^^^^^
6161
| |
62-
| this calls a custom destructor and let us call it `#1`
62+
| this value will be stored in a temporary; let us call it `#1`
6363
| up until Edition 2021 `#1` is dropped last but will be dropped earlier in Edition 2024
6464
...
6565
LL | }
@@ -103,7 +103,7 @@ LL | let x = LoudDropper;
103103
LL | { LoudDropper.get() }
104104
| ^^^^^^^^^^^
105105
| |
106-
| this calls a custom destructor and let us call it `#1`
106+
| this value will be stored in a temporary; let us call it `#1`
107107
| up until Edition 2021 `#1` is dropped last but will be dropped earlier in Edition 2024
108108
...
109109
LL | }
@@ -147,7 +147,7 @@ LL | let future = f();
147147
LL | LoudDropper.get()
148148
| ^^^^^^^^^^^
149149
| |
150-
| this calls a custom destructor and let us call it `#1`
150+
| this value will be stored in a temporary; let us call it `#1`
151151
| up until Edition 2021 `#1` is dropped last but will be dropped earlier in Edition 2024
152152
...
153153
LL | }
@@ -191,7 +191,7 @@ LL | let x = T::default();
191191
LL | extract(&T::default())
192192
| ^^^^^^^^^^^^
193193
| |
194-
| this calls a custom destructor and let us call it `#1`
194+
| this value will be stored in a temporary; let us call it `#1`
195195
| up until Edition 2021 `#1` is dropped last but will be dropped earlier in Edition 2024
196196
...
197197
LL | }
@@ -213,7 +213,7 @@ LL | let x: Result<LoudDropper, ()> = Ok(LoudDropper);
213213
LL | LoudDropper.get()
214214
| ^^^^^^^^^^^
215215
| |
216-
| this calls a custom destructor and let us call it `#1`
216+
| this value will be stored in a temporary; let us call it `#1`
217217
| up until Edition 2021 `#1` is dropped last but will be dropped earlier in Edition 2024
218218
...
219219
LL | }
@@ -257,7 +257,7 @@ LL | let x = LoudDropper2;
257257
LL | LoudDropper3.get()
258258
| ^^^^^^^^^^^^
259259
| |
260-
| this calls a custom destructor and let us call it `#1`
260+
| this value will be stored in a temporary; let us call it `#1`
261261
| up until Edition 2021 `#1` is dropped last but will be dropped earlier in Edition 2024
262262
...
263263
LL | }
@@ -293,7 +293,7 @@ error: relative drop order changing in Rust 2024
293293
LL | LoudDropper.get()
294294
| ^^^^^^^^^^^
295295
| |
296-
| this calls a custom destructor and let us call it `#1`
296+
| this value will be stored in a temporary; let us call it `#1`
297297
| up until Edition 2021 `#1` is dropped last but will be dropped earlier in Edition 2024
298298
...
299299
LL | let _x = LoudDropper;

0 commit comments

Comments
 (0)