11error[E0764]: mutable references are not allowed in the final value of constants
2- --> $DIR/mut_ref_in_final.rs:13 :21
2+ --> $DIR/mut_ref_in_final.rs:12 :21
33 |
44LL | const B: *mut i32 = &mut 4;
55 | ^^^^^^
66
77error[E0716]: temporary value dropped while borrowed
8- --> $DIR/mut_ref_in_final.rs:19 :40
8+ --> $DIR/mut_ref_in_final.rs:18 :40
99 |
1010LL | const B3: Option<&mut i32> = Some(&mut 42);
1111 | ----------^^-
@@ -15,17 +15,17 @@ LL | const B3: Option<&mut i32> = Some(&mut 42);
1515 | using this value as a constant requires that borrow lasts for `'static`
1616
1717error[E0716]: temporary value dropped while borrowed
18- --> $DIR/mut_ref_in_final.rs:32:43
18+ --> $DIR/mut_ref_in_final.rs:21:42
1919 |
20- LL | const B5 : Option<&mut i32> = helper2 (&mut 42);
21- | ------------- ^^-
22- | | | |
23- | | | temporary value is freed at the end of this statement
24- | | creates a temporary which is freed while still in use
20+ LL | const B4 : Option<&mut i32> = helper (&mut 42);
21+ | ------------^^-
22+ | | | |
23+ | | | temporary value is freed at the end of this statement
24+ | | creates a temporary which is freed while still in use
2525 | using this value as a constant requires that borrow lasts for `'static`
2626
2727error[E0716]: temporary value dropped while borrowed
28- --> $DIR/mut_ref_in_final.rs:47 :65
28+ --> $DIR/mut_ref_in_final.rs:36 :65
2929 |
3030LL | const FOO: NotAMutex<&mut i32> = NotAMutex(UnsafeCell::new(&mut 42));
3131 | -------------------------------^^--
@@ -35,7 +35,7 @@ LL | const FOO: NotAMutex<&mut i32> = NotAMutex(UnsafeCell::new(&mut 42));
3535 | using this value as a constant requires that borrow lasts for `'static`
3636
3737error[E0716]: temporary value dropped while borrowed
38- --> $DIR/mut_ref_in_final.rs:50 :67
38+ --> $DIR/mut_ref_in_final.rs:39 :67
3939 |
4040LL | static FOO2: NotAMutex<&mut i32> = NotAMutex(UnsafeCell::new(&mut 42));
4141 | -------------------------------^^--
@@ -45,7 +45,7 @@ LL | static FOO2: NotAMutex<&mut i32> = NotAMutex(UnsafeCell::new(&mut 42));
4545 | using this value as a static requires that borrow lasts for `'static`
4646
4747error[E0716]: temporary value dropped while borrowed
48- --> $DIR/mut_ref_in_final.rs:53 :71
48+ --> $DIR/mut_ref_in_final.rs:42 :71
4949 |
5050LL | static mut FOO3: NotAMutex<&mut i32> = NotAMutex(UnsafeCell::new(&mut 42));
5151 | -------------------------------^^--
0 commit comments