Skip to content

Commit ea4d934

Browse files
pnkfelixmikhail-m1
authored andcommitted
Change the diagnostic number from 714 to 716.
1 parent 5fc0b74 commit ea4d934

25 files changed

+58
-58
lines changed

src/librustc_mir/diagnostics.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -2263,13 +2263,13 @@ lifetime, which would again violate the `&mut`-borrow's exclusive
22632263
access.
22642264
"##,
22652265

2266-
E0714: r##"
2266+
E0716: r##"
22672267
This error indicates that a temporary value is being dropped
22682268
while a borrow is still in active use.
22692269
22702270
Erroneous code example:
22712271
2272-
```compile_fail,E0714
2272+
```compile_fail,E0716
22732273
# #![feature(nll)]
22742274
fn foo() -> i32 { 22 }
22752275
fn bar(x: &i32) -> &i32 { x }

src/librustc_mir/util/borrowck_errors.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -739,7 +739,7 @@ pub trait BorrowckErrors<'cx>: Sized + Copy {
739739
let err = struct_span_err!(
740740
self,
741741
span,
742-
E0714,
742+
E0716,
743743
"temporary value dropped while borrowed{OGN}",
744744
OGN = o
745745
);

src/test/ui/borrowck/borrowck-borrow-from-temporary.nll.stderr

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
error[E0714]: temporary value dropped while borrowed
1+
error[E0716]: temporary value dropped while borrowed
22
--> $DIR/borrowck-borrow-from-temporary.rs:19:24
33
|
44
LL | let &Foo(ref x) = &id(Foo(3)); //~ ERROR borrowed value does not live long enough
@@ -15,4 +15,4 @@ LL | fn foo<'a>() -> &'a isize {
1515

1616
error: aborting due to previous error
1717

18-
For more information about this error, try `rustc --explain E0714`.
18+
For more information about this error, try `rustc --explain E0716`.

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

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
error[E0714]: temporary value dropped while borrowed
1+
error[E0716]: temporary value dropped while borrowed
22
--> $DIR/borrowck-borrowed-uniq-rvalue-2.rs:32:20
33
|
44
LL | let x = defer(&vec!["Goodbye", "world!"]);
@@ -13,4 +13,4 @@ LL | x.x[0];
1313

1414
error: aborting due to previous error
1515

16-
For more information about this error, try `rustc --explain E0714`.
16+
For more information about this error, try `rustc --explain E0716`.

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

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
error[E0714]: temporary value dropped while borrowed
1+
error[E0716]: temporary value dropped while borrowed
22
--> $DIR/borrowck-borrowed-uniq-rvalue.rs:20:28
33
|
44
LL | buggy_map.insert(42, &*Box::new(1)); //~ ERROR borrowed value does not live long enough
@@ -13,4 +13,4 @@ LL | buggy_map.insert(43, &*tmp);
1313

1414
error: aborting due to previous error
1515

16-
For more information about this error, try `rustc --explain E0714`.
16+
For more information about this error, try `rustc --explain E0716`.

src/test/ui/borrowck/promote-ref-mut-in-let-issue-46557.nll.stderr

+6-6
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
error[E0714]: temporary value dropped while borrowed
1+
error[E0716]: temporary value dropped while borrowed
22
--> $DIR/promote-ref-mut-in-let-issue-46557.rs:15:21
33
|
44
LL | let ref mut x = 1234543; //~ ERROR
@@ -9,7 +9,7 @@ LL | }
99
|
1010
= note: borrowed value must be valid for the static lifetime...
1111

12-
error[E0714]: temporary value dropped while borrowed
12+
error[E0716]: temporary value dropped while borrowed
1313
--> $DIR/promote-ref-mut-in-let-issue-46557.rs:20:25
1414
|
1515
LL | let (ref mut x, ) = (1234543, ); //~ ERROR
@@ -20,7 +20,7 @@ LL | }
2020
|
2121
= note: borrowed value must be valid for the static lifetime...
2222

23-
error[E0714]: temporary value dropped while borrowed
23+
error[E0716]: temporary value dropped while borrowed
2424
--> $DIR/promote-ref-mut-in-let-issue-46557.rs:25:11
2525
|
2626
LL | match 1234543 {
@@ -31,7 +31,7 @@ LL | }
3131
|
3232
= note: borrowed value must be valid for the static lifetime...
3333

34-
error[E0714]: temporary value dropped while borrowed
34+
error[E0716]: temporary value dropped while borrowed
3535
--> $DIR/promote-ref-mut-in-let-issue-46557.rs:31:11
3636
|
3737
LL | match (123443,) {
@@ -42,7 +42,7 @@ LL | }
4242
|
4343
= note: borrowed value must be valid for the static lifetime...
4444

45-
error[E0714]: temporary value dropped while borrowed
45+
error[E0716]: temporary value dropped while borrowed
4646
--> $DIR/promote-ref-mut-in-let-issue-46557.rs:37:10
4747
|
4848
LL | &mut 1234543 //~ ERROR
@@ -54,4 +54,4 @@ LL | }
5454

5555
error: aborting due to 5 previous errors
5656

57-
For more information about this error, try `rustc --explain E0714`.
57+
For more information about this error, try `rustc --explain E0716`.

src/test/ui/consts/const-eval/dont_promote_unstable_const_fn.nll.stderr

+4-4
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ LL | const fn bar() -> u32 { foo() } //~ ERROR `foo` is not yet stable as a cons
66
|
77
= help: in Nightly builds, add `#![feature(foo)]` to the crate attributes to enable
88

9-
error[E0714]: temporary value dropped while borrowed
9+
error[E0716]: temporary value dropped while borrowed
1010
--> $DIR/dont_promote_unstable_const_fn.rs:28:28
1111
|
1212
LL | let _: &'static u32 = &foo(); //~ ERROR does not live long enough
@@ -16,7 +16,7 @@ LL | }
1616
|
1717
= note: borrowed value must be valid for the static lifetime...
1818

19-
error[E0714]: temporary value dropped while borrowed
19+
error[E0716]: temporary value dropped while borrowed
2020
--> $DIR/dont_promote_unstable_const_fn.rs:32:28
2121
|
2222
LL | let _: &'static u32 = &meh(); //~ ERROR does not live long enough
@@ -27,7 +27,7 @@ LL | }
2727
|
2828
= note: borrowed value must be valid for the static lifetime...
2929

30-
error[E0714]: temporary value dropped while borrowed
30+
error[E0716]: temporary value dropped while borrowed
3131
--> $DIR/dont_promote_unstable_const_fn.rs:33:26
3232
|
3333
LL | let x: &'static _ = &std::time::Duration::from_millis(42).subsec_millis();
@@ -40,4 +40,4 @@ LL | }
4040

4141
error: aborting due to 4 previous errors
4242

43-
For more information about this error, try `rustc --explain E0714`.
43+
For more information about this error, try `rustc --explain E0716`.

src/test/ui/consts/const-eval/dont_promote_unstable_const_fn_cross_crate.nll.stderr

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
error[E0714]: temporary value dropped while borrowed
1+
error[E0716]: temporary value dropped while borrowed
22
--> $DIR/dont_promote_unstable_const_fn_cross_crate.rs:18:28
33
|
44
LL | let _: &'static u32 = &foo(); //~ ERROR does not live long enough
@@ -9,7 +9,7 @@ LL | }
99
|
1010
= note: borrowed value must be valid for the static lifetime...
1111

12-
error[E0714]: temporary value dropped while borrowed
12+
error[E0716]: temporary value dropped while borrowed
1313
--> $DIR/dont_promote_unstable_const_fn_cross_crate.rs:19:29
1414
|
1515
LL | let _x: &'static u32 = &foo(); //~ ERROR does not live long enough
@@ -21,4 +21,4 @@ LL | }
2121

2222
error: aborting due to 2 previous errors
2323

24-
For more information about this error, try `rustc --explain E0714`.
24+
For more information about this error, try `rustc --explain E0716`.

src/test/ui/consts/const-eval/promoted_raw_ptr_ops.nll.stderr

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
error[E0714]: temporary value dropped while borrowed
1+
error[E0716]: temporary value dropped while borrowed
22
--> $DIR/promoted_raw_ptr_ops.rs:14:29
33
|
44
LL | let x: &'static bool = &(42 as *const i32 == 43 as *const i32);
@@ -9,7 +9,7 @@ LL | }
99
|
1010
= note: borrowed value must be valid for the static lifetime...
1111

12-
error[E0714]: temporary value dropped while borrowed
12+
error[E0716]: temporary value dropped while borrowed
1313
--> $DIR/promoted_raw_ptr_ops.rs:16:30
1414
|
1515
LL | let y: &'static usize = &(&1 as *const i32 as usize + 1); //~ ERROR does not live long enough
@@ -20,7 +20,7 @@ LL | }
2020
|
2121
= note: borrowed value must be valid for the static lifetime...
2222

23-
error[E0714]: temporary value dropped while borrowed
23+
error[E0716]: temporary value dropped while borrowed
2424
--> $DIR/promoted_raw_ptr_ops.rs:17:28
2525
|
2626
LL | let z: &'static i32 = &(unsafe { *(42 as *const i32) }); //~ ERROR does not live long enough
@@ -32,4 +32,4 @@ LL | }
3232

3333
error: aborting due to 3 previous errors
3434

35-
For more information about this error, try `rustc --explain E0714`.
35+
For more information about this error, try `rustc --explain E0716`.

src/test/ui/consts/const-eval/transmute-const-promotion.nll.stderr

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
error[E0714]: temporary value dropped while borrowed
1+
error[E0716]: temporary value dropped while borrowed
22
--> $DIR/transmute-const-promotion.rs:16:37
33
|
44
LL | let x: &'static u32 = unsafe { &mem::transmute(3.0f32) };
@@ -11,4 +11,4 @@ LL | }
1111

1212
error: aborting due to previous error
1313

14-
For more information about this error, try `rustc --explain E0714`.
14+
For more information about this error, try `rustc --explain E0716`.

src/test/ui/issues/issue-36082.mir.stderr

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
error[E0714]: temporary value dropped while borrowed
1+
error[E0716]: temporary value dropped while borrowed
22
--> $DIR/issue-36082.rs:23:19
33
|
44
LL | let val: &_ = x.borrow().0;
@@ -13,4 +13,4 @@ LL | println!("{}", val);
1313

1414
error: aborting due to previous error
1515

16-
For more information about this error, try `rustc --explain E0714`.
16+
For more information about this error, try `rustc --explain E0716`.

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ fn main() {
2525
//[ast]~| NOTE temporary value dropped here while still borrowed
2626
//[ast]~| NOTE temporary value does not live long enough
2727
//[ast]~| NOTE consider using a `let` binding to increase its lifetime
28-
//[mir]~^^^^^ ERROR temporary value dropped while borrowed [E0714]
28+
//[mir]~^^^^^ ERROR temporary value dropped while borrowed [E0716]
2929
//[mir]~| NOTE temporary value is freed at the end of this statement
3030
//[mir]~| NOTE creates a temporary which is freed while still in use
3131
//[mir]~| NOTE consider using a `let` binding to create a longer lived value

src/test/ui/issues/issue-46472.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
fn bar<'a>() -> &'a mut u32 {
1414
&mut 4
1515
//~^ ERROR borrowed value does not live long enough (Ast) [E0597]
16-
//~| ERROR temporary value dropped while borrowed (Mir) [E0714]
16+
//~| ERROR temporary value dropped while borrowed (Mir) [E0716]
1717
}
1818

1919
fn main() { }

src/test/ui/issues/issue-46472.stderr

+2-2
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ note: borrowed value must be valid for the lifetime 'a as defined on the functio
1313
LL | fn bar<'a>() -> &'a mut u32 {
1414
| ^^
1515

16-
error[E0714]: temporary value dropped while borrowed (Mir)
16+
error[E0716]: temporary value dropped while borrowed (Mir)
1717
--> $DIR/issue-46472.rs:14:10
1818
|
1919
LL | &mut 4
@@ -30,5 +30,5 @@ LL | fn bar<'a>() -> &'a mut u32 {
3030

3131
error: aborting due to 2 previous errors
3232

33-
Some errors occurred: E0597, E0714.
33+
Some errors occurred: E0597, E0716.
3434
For more information about an error, try `rustc --explain E0597`.

src/test/ui/issues/issue-47184.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,5 +12,5 @@
1212

1313
fn main() {
1414
let _vec: Vec<&'static String> = vec![&String::new()];
15-
//~^ ERROR temporary value dropped while borrowed [E0714]
15+
//~^ ERROR temporary value dropped while borrowed [E0716]
1616
}

src/test/ui/issues/issue-47184.stderr

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
error[E0714]: temporary value dropped while borrowed
1+
error[E0716]: temporary value dropped while borrowed
22
--> $DIR/issue-47184.rs:14:44
33
|
44
LL | let _vec: Vec<&'static String> = vec![&String::new()];
@@ -10,4 +10,4 @@ LL | let _vec: Vec<&'static String> = vec![&String::new()];
1010

1111
error: aborting due to previous error
1212

13-
For more information about this error, try `rustc --explain E0714`.
13+
For more information about this error, try `rustc --explain E0716`.

src/test/ui/nll/borrowed-temporary-error.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ fn main() {
1818
let x = gimme({
1919
let v = 22;
2020
&(v,)
21-
//~^ ERROR temporary value dropped while borrowed [E0714]
21+
//~^ ERROR temporary value dropped while borrowed [E0716]
2222
});
2323
println!("{:?}", x);
2424
}
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
error[E0714]: temporary value dropped while borrowed
1+
error[E0716]: temporary value dropped while borrowed
22
--> $DIR/borrowed-temporary-error.rs:20:10
33
|
44
LL | &(v,)
55
| ^^^^ creates a temporary which is freed while still in use
6-
LL | //~^ ERROR temporary value dropped while borrowed [E0714]
6+
LL | //~^ ERROR temporary value dropped while borrowed [E0716]
77
LL | });
88
| - temporary value is freed at the end of this statement
99
LL | println!("{:?}", x);
@@ -13,4 +13,4 @@ LL | println!("{:?}", x);
1313

1414
error: aborting due to previous error
1515

16-
For more information about this error, try `rustc --explain E0714`.
16+
For more information about this error, try `rustc --explain E0716`.

src/test/ui/nll/borrowed-universal-error.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ fn gimme(x: &(u32,)) -> &u32 {
1818
fn foo<'a>(x: &'a (u32,)) -> &'a u32 {
1919
let v = 22;
2020
gimme(&(v,))
21-
//~^ ERROR temporary value dropped while borrowed [E0714]
21+
//~^ ERROR temporary value dropped while borrowed [E0716]
2222
}
2323

2424
fn main() {}

src/test/ui/nll/borrowed-universal-error.stderr

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
error[E0714]: temporary value dropped while borrowed
1+
error[E0716]: temporary value dropped while borrowed
22
--> $DIR/borrowed-universal-error.rs:20:12
33
|
44
LL | gimme(&(v,))
55
| ^^^^ creates a temporary which is freed while still in use
6-
LL | //~^ ERROR temporary value dropped while borrowed [E0714]
6+
LL | //~^ ERROR temporary value dropped while borrowed [E0716]
77
LL | }
88
| - temporary value is freed at the end of this statement
99
|
@@ -15,4 +15,4 @@ LL | fn foo<'a>(x: &'a (u32,)) -> &'a u32 {
1515

1616
error: aborting due to previous error
1717

18-
For more information about this error, try `rustc --explain E0714`.
18+
For more information about this error, try `rustc --explain E0716`.

src/test/ui/nll/issue-52534-1.stderr

+2-2
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ LL | }
5252
= note: functions cannot return a borrow to data owned within the function's scope, functions can only return borrows to data passed as arguments
5353
= note: to learn more, visit <https://doc.rust-lang.org/book/second-edition/ch04-02-references-and-borrowing.html#dangling-references>
5454

55-
error[E0714]: temporary value dropped while borrowed
55+
error[E0716]: temporary value dropped while borrowed
5656
--> $DIR/issue-52534-1.rs:30:6
5757
|
5858
LL | &&x
@@ -137,5 +137,5 @@ LL | }
137137

138138
error: aborting due to 8 previous errors
139139

140-
Some errors occurred: E0597, E0714.
140+
Some errors occurred: E0597, E0716.
141141
For more information about an error, try `rustc --explain E0597`.

src/test/ui/nll/return-ref-mut-issue-46557.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
#![allow(dead_code)]
1515

1616
fn gimme_static_mut() -> &'static mut u32 {
17-
let ref mut x = 1234543; //~ ERROR temporary value dropped while borrowed [E0714]
17+
let ref mut x = 1234543; //~ ERROR temporary value dropped while borrowed [E0716]
1818
x
1919
}
2020

Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
error[E0714]: temporary value dropped while borrowed
1+
error[E0716]: temporary value dropped while borrowed
22
--> $DIR/return-ref-mut-issue-46557.rs:17:21
33
|
4-
LL | let ref mut x = 1234543; //~ ERROR temporary value dropped while borrowed [E0714]
4+
LL | let ref mut x = 1234543; //~ ERROR temporary value dropped while borrowed [E0716]
55
| ^^^^^^^ creates a temporary which is freed while still in use
66
LL | x
77
LL | }
@@ -11,4 +11,4 @@ LL | }
1111

1212
error: aborting due to previous error
1313

14-
For more information about this error, try `rustc --explain E0714`.
14+
For more information about this error, try `rustc --explain E0716`.

src/test/ui/nll/user-annotations/patterns.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -51,13 +51,13 @@ fn underscore_with_initializer() {
5151
let _: &'static u32 = &x; //~ ERROR
5252

5353
let _: Vec<&'static String> = vec![&String::new()];
54-
//~^ ERROR temporary value dropped while borrowed [E0714]
54+
//~^ ERROR temporary value dropped while borrowed [E0716]
5555

5656
let (_, a): (Vec<&'static String>, _) = (vec![&String::new()], 44);
57-
//~^ ERROR temporary value dropped while borrowed [E0714]
57+
//~^ ERROR temporary value dropped while borrowed [E0716]
5858

5959
let (_a, b): (Vec<&'static String>, _) = (vec![&String::new()], 44);
60-
//~^ ERROR temporary value dropped while borrowed [E0714]
60+
//~^ ERROR temporary value dropped while borrowed [E0716]
6161
}
6262

6363
fn pair_underscores_with_initializer() {

0 commit comments

Comments
 (0)