Skip to content

Commit bcc1781

Browse files
authored
Rollup merge of rust-lang#103307 - b4den:master, r=estebank
Add context to compiler error message Changed `creates a temporary which is freed while still in use` to `creates a temporary value which is freed while still in use`.
2 parents edda37a + 6cb6564 commit bcc1781

File tree

54 files changed

+128
-128
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

54 files changed

+128
-128
lines changed

compiler/rustc_borrowck/src/diagnostics/conflict_errors.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1557,7 +1557,7 @@ impl<'cx, 'tcx> MirBorrowckCtxt<'cx, 'tcx> {
15571557
}
15581558

15591559
let mut err = self.temporary_value_borrowed_for_too_long(proper_span);
1560-
err.span_label(proper_span, "creates a temporary which is freed while still in use");
1560+
err.span_label(proper_span, "creates a temporary value which is freed while still in use");
15611561
err.span_label(drop_span, "temporary value is freed at the end of this statement");
15621562

15631563
match explanation {

library/core/src/pin.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1059,7 +1059,7 @@ impl<P, U> DispatchFromDyn<Pin<U>> for Pin<P> where P: DispatchFromDyn<U> {}
10591059
/// 8 | let x: Pin<&mut Foo> = {
10601060
/// | - borrow later stored here
10611061
/// 9 | let x: Pin<&mut Foo> = pin!(Foo { /* … */ });
1062-
/// | ^^^^^^^^^^^^^^^^^^^^^ creates a temporary which is freed while still in use
1062+
/// | ^^^^^^^^^^^^^^^^^^^^^ creates a temporary value which is freed while still in use
10631063
/// 10 | x
10641064
/// 11 | }; // <- Foo is dropped
10651065
/// | - temporary value is freed at the end of this statement

src/test/ui/borrowck/borrowck-borrowed-uniq-rvalue-2.stderr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ error[E0716]: temporary value dropped while borrowed
44
LL | let x = defer(&vec!["Goodbye", "world!"]);
55
| ^^^^^^^^^^^^^^^^^^^^^^^^^ - temporary value is freed at the end of this statement
66
| |
7-
| creates a temporary which is freed while still in use
7+
| creates a temporary value which is freed while still in use
88
LL | x.x[0];
99
| ------ borrow later used here
1010
|

src/test/ui/borrowck/borrowck-borrowed-uniq-rvalue.stderr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ error[E0716]: temporary value dropped while borrowed
44
LL | buggy_map.insert(42, &*Box::new(1));
55
| ^^^^^^^^^^^ - temporary value is freed at the end of this statement
66
| |
7-
| creates a temporary which is freed while still in use
7+
| creates a temporary value which is freed while still in use
88
...
99
LL | buggy_map.insert(43, &*tmp);
1010
| --------------------------- borrow later used here

src/test/ui/borrowck/issue-11493.stderr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ error[E0716]: temporary value dropped while borrowed
44
LL | let y = x.as_ref().unwrap_or(&id(5));
55
| ^^^^^ - temporary value is freed at the end of this statement
66
| |
7-
| creates a temporary which is freed while still in use
7+
| creates a temporary value which is freed while still in use
88
LL | let _ = &y;
99
| -- borrow later used here
1010
|

src/test/ui/borrowck/issue-17545.stderr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ LL | pub fn foo<'a, F: Fn(&'a ())>(bar: F) {
55
| -- lifetime `'a` defined here
66
LL | / bar.call((
77
LL | | &id(()),
8-
| | ^^^^^^ creates a temporary which is freed while still in use
8+
| | ^^^^^^ creates a temporary value which is freed while still in use
99
LL | | ));
1010
| | -- temporary value is freed at the end of this statement
1111
| |______|

src/test/ui/borrowck/issue-36082.fixed

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ fn main() {
1010
let val: &_ = binding.0;
1111
//~^ ERROR temporary value dropped while borrowed [E0716]
1212
//~| NOTE temporary value is freed at the end of this statement
13-
//~| NOTE creates a temporary which is freed while still in use
13+
//~| NOTE creates a temporary value which is freed while still in use
1414
//~| HELP consider using a `let` binding to create a longer lived value
1515
println!("{}", val);
1616
//~^ borrow later used here

src/test/ui/borrowck/issue-36082.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ fn main() {
99
let val: &_ = x.borrow().0;
1010
//~^ ERROR temporary value dropped while borrowed [E0716]
1111
//~| NOTE temporary value is freed at the end of this statement
12-
//~| NOTE creates a temporary which is freed while still in use
12+
//~| NOTE creates a temporary value which is freed while still in use
1313
//~| HELP consider using a `let` binding to create a longer lived value
1414
println!("{}", val);
1515
//~^ borrow later used here

src/test/ui/borrowck/issue-36082.stderr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ error[E0716]: temporary value dropped while borrowed
44
LL | let val: &_ = x.borrow().0;
55
| ^^^^^^^^^^ - temporary value is freed at the end of this statement
66
| |
7-
| creates a temporary which is freed while still in use
7+
| creates a temporary value which is freed while still in use
88
...
99
LL | println!("{}", val);
1010
| --- borrow later used here

src/test/ui/cleanup-rvalue-scopes-cf.stderr

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ error[E0716]: temporary value dropped while borrowed
44
LL | let x1 = arg(&AddFlags(1));
55
| ^^^^^^^^^^^ - temporary value is freed at the end of this statement
66
| |
7-
| creates a temporary which is freed while still in use
7+
| creates a temporary value which is freed while still in use
88
...
99
LL | (x1, x2, x3, x4, x5, x6, x7);
1010
| -- borrow later used here
@@ -21,7 +21,7 @@ error[E0716]: temporary value dropped while borrowed
2121
LL | let x2 = AddFlags(1).get();
2222
| ^^^^^^^^^^^ - temporary value is freed at the end of this statement
2323
| |
24-
| creates a temporary which is freed while still in use
24+
| creates a temporary value which is freed while still in use
2525
...
2626
LL | (x1, x2, x3, x4, x5, x6, x7);
2727
| -- borrow later used here
@@ -38,7 +38,7 @@ error[E0716]: temporary value dropped while borrowed
3838
LL | let x3 = &*arg(&AddFlags(1));
3939
| ^^^^^^^^^^^ - temporary value is freed at the end of this statement
4040
| |
41-
| creates a temporary which is freed while still in use
41+
| creates a temporary value which is freed while still in use
4242
...
4343
LL | (x1, x2, x3, x4, x5, x6, x7);
4444
| -- borrow later used here
@@ -55,7 +55,7 @@ error[E0716]: temporary value dropped while borrowed
5555
LL | let ref x4 = *arg(&AddFlags(1));
5656
| ^^^^^^^^^^^ - temporary value is freed at the end of this statement
5757
| |
58-
| creates a temporary which is freed while still in use
58+
| creates a temporary value which is freed while still in use
5959
...
6060
LL | (x1, x2, x3, x4, x5, x6, x7);
6161
| -- borrow later used here
@@ -72,7 +72,7 @@ error[E0716]: temporary value dropped while borrowed
7272
LL | let &ref x5 = arg(&AddFlags(1));
7373
| ^^^^^^^^^^^ - temporary value is freed at the end of this statement
7474
| |
75-
| creates a temporary which is freed while still in use
75+
| creates a temporary value which is freed while still in use
7676
...
7777
LL | (x1, x2, x3, x4, x5, x6, x7);
7878
| -- borrow later used here
@@ -89,7 +89,7 @@ error[E0716]: temporary value dropped while borrowed
8989
LL | let x6 = AddFlags(1).get();
9090
| ^^^^^^^^^^^ - temporary value is freed at the end of this statement
9191
| |
92-
| creates a temporary which is freed while still in use
92+
| creates a temporary value which is freed while still in use
9393
...
9494
LL | (x1, x2, x3, x4, x5, x6, x7);
9595
| -- borrow later used here
@@ -106,7 +106,7 @@ error[E0716]: temporary value dropped while borrowed
106106
LL | let StackBox { f: x7 } = StackBox { f: AddFlags(1).get() };
107107
| ^^^^^^^^^^^ - temporary value is freed at the end of this statement
108108
| |
109-
| creates a temporary which is freed while still in use
109+
| creates a temporary value which is freed while still in use
110110
LL |
111111
LL | (x1, x2, x3, x4, x5, x6, x7);
112112
| -- borrow later used here

0 commit comments

Comments
 (0)