1 error[E0764]: mutable references are not allowed in the final value of constants
2 --> $DIR/mut_ref_in_final.rs:11:21
4 LL | const B: *mut i32 = &mut 4;
7 error[E0716]: temporary value dropped while borrowed
8 --> $DIR/mut_ref_in_final.rs:17:40
10 LL | const B3: Option<&mut i32> = Some(&mut 42);
13 | | | temporary value is freed at the end of this statement
14 | | creates a temporary which is freed while still in use
15 | using this value as a constant requires that borrow lasts for `'static`
17 error[E0716]: temporary value dropped while borrowed
18 --> $DIR/mut_ref_in_final.rs:20:42
20 LL | const B4: Option<&mut i32> = helper(&mut 42);
23 | | | temporary value is freed at the end of this statement
24 | | creates a temporary which is freed while still in use
25 | using this value as a constant requires that borrow lasts for `'static`
27 error[E0716]: temporary value dropped while borrowed
28 --> $DIR/mut_ref_in_final.rs:35:65
30 LL | const FOO: NotAMutex<&mut i32> = NotAMutex(UnsafeCell::new(&mut 42));
31 | -------------------------------^^--
33 | | | temporary value is freed at the end of this statement
34 | | creates a temporary which is freed while still in use
35 | using this value as a constant requires that borrow lasts for `'static`
37 error[E0716]: temporary value dropped while borrowed
38 --> $DIR/mut_ref_in_final.rs:38:67
40 LL | static FOO2: NotAMutex<&mut i32> = NotAMutex(UnsafeCell::new(&mut 42));
41 | -------------------------------^^--
43 | | | temporary value is freed at the end of this statement
44 | | creates a temporary which is freed while still in use
45 | using this value as a static requires that borrow lasts for `'static`
47 error[E0716]: temporary value dropped while borrowed
48 --> $DIR/mut_ref_in_final.rs:41:71
50 LL | static mut FOO3: NotAMutex<&mut i32> = NotAMutex(UnsafeCell::new(&mut 42));
51 | -------------------------------^^--
53 | | | temporary value is freed at the end of this statement
54 | | creates a temporary which is freed while still in use
55 | using this value as a static requires that borrow lasts for `'static`
57 error: aborting due to 6 previous errors
59 Some errors have detailed explanations: E0716, E0764.
60 For more information about an error, try `rustc --explain E0716`.