1
1
error[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
3
3
|
4
4
LL | const B: *mut i32 = &mut 4;
5
5
| ^^^^^^
6
6
7
7
error[E0716]: temporary value dropped while borrowed
8
- --> $DIR/mut_ref_in_final.rs:19 :40
8
+ --> $DIR/mut_ref_in_final.rs:18 :40
9
9
|
10
10
LL | const B3: Option<&mut i32> = Some(&mut 42);
11
11
| ----------^^-
@@ -15,17 +15,17 @@ LL | const B3: Option<&mut i32> = Some(&mut 42);
15
15
| using this value as a constant requires that borrow lasts for `'static`
16
16
17
17
error[E0716]: temporary value dropped while borrowed
18
- --> $DIR/mut_ref_in_final.rs:32:43
18
+ --> $DIR/mut_ref_in_final.rs:21:42
19
19
|
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
25
25
| using this value as a constant requires that borrow lasts for `'static`
26
26
27
27
error[E0716]: temporary value dropped while borrowed
28
- --> $DIR/mut_ref_in_final.rs:47 :65
28
+ --> $DIR/mut_ref_in_final.rs:36 :65
29
29
|
30
30
LL | const FOO: NotAMutex<&mut i32> = NotAMutex(UnsafeCell::new(&mut 42));
31
31
| -------------------------------^^--
@@ -35,7 +35,7 @@ LL | const FOO: NotAMutex<&mut i32> = NotAMutex(UnsafeCell::new(&mut 42));
35
35
| using this value as a constant requires that borrow lasts for `'static`
36
36
37
37
error[E0716]: temporary value dropped while borrowed
38
- --> $DIR/mut_ref_in_final.rs:50 :67
38
+ --> $DIR/mut_ref_in_final.rs:39 :67
39
39
|
40
40
LL | static FOO2: NotAMutex<&mut i32> = NotAMutex(UnsafeCell::new(&mut 42));
41
41
| -------------------------------^^--
@@ -45,7 +45,7 @@ LL | static FOO2: NotAMutex<&mut i32> = NotAMutex(UnsafeCell::new(&mut 42));
45
45
| using this value as a static requires that borrow lasts for `'static`
46
46
47
47
error[E0716]: temporary value dropped while borrowed
48
- --> $DIR/mut_ref_in_final.rs:53 :71
48
+ --> $DIR/mut_ref_in_final.rs:42 :71
49
49
|
50
50
LL | static mut FOO3: NotAMutex<&mut i32> = NotAMutex(UnsafeCell::new(&mut 42));
51
51
| -------------------------------^^--
0 commit comments