Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 46bc12c

Browse files
authoredNov 9, 2022
Rollup merge of #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 2206267 + 6cb6564 commit 46bc12c

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

0 commit comments

Comments
 (0)
Please sign in to comment.