@@ -4,19 +4,19 @@ error[E0764]: mutable borrows of temporaries that have their lifetime extended u
44LL | const B: *mut i32 = &mut 4;
55 | ^^^^^^ this mutable borrow refers to such a temporary
66 |
7- = note: Temporaries in constants and statics can have their lifetime extended until the end of the program
8- = note: To avoid accidentally creating global mutable state, such temporaries must be immutable
9- = help: If you really want global mutable state, try replacing the temporary by an interior mutable `static` or a `static mut`
7+ = note: temporaries in constants and statics can have their lifetime extended until the end of the program
8+ = note: to avoid accidentally creating global mutable state, such temporaries must be immutable
9+ = help: if you really want global mutable state, try replacing the temporary by an interior mutable `static` or a `static mut`
1010
1111error[E0764]: mutable borrows of temporaries that have their lifetime extended until the end of the program are not allowed
1212 --> $DIR/mut_ref_in_final.rs:21:35
1313 |
1414LL | const B3: Option<&mut i32> = Some(&mut 42);
1515 | ^^^^^^^ this mutable borrow refers to such a temporary
1616 |
17- = note: Temporaries in constants and statics can have their lifetime extended until the end of the program
18- = note: To avoid accidentally creating global mutable state, such temporaries must be immutable
19- = help: If you really want global mutable state, try replacing the temporary by an interior mutable `static` or a `static mut`
17+ = note: temporaries in constants and statics can have their lifetime extended until the end of the program
18+ = note: to avoid accidentally creating global mutable state, such temporaries must be immutable
19+ = help: if you really want global mutable state, try replacing the temporary by an interior mutable `static` or a `static mut`
2020
2121error[E0716]: temporary value dropped while borrowed
2222 --> $DIR/mut_ref_in_final.rs:24:42
@@ -86,39 +86,39 @@ error[E0764]: mutable borrows of temporaries that have their lifetime extended u
8686LL | static RAW_MUT_CAST_S: SyncPtr<i32> = SyncPtr { x : &mut 42 as *mut _ as *const _ };
8787 | ^^^^^^^ this mutable borrow refers to such a temporary
8888 |
89- = note: Temporaries in constants and statics can have their lifetime extended until the end of the program
90- = note: To avoid accidentally creating global mutable state, such temporaries must be immutable
91- = help: If you really want global mutable state, try replacing the temporary by an interior mutable `static` or a `static mut`
89+ = note: temporaries in constants and statics can have their lifetime extended until the end of the program
90+ = note: to avoid accidentally creating global mutable state, such temporaries must be immutable
91+ = help: if you really want global mutable state, try replacing the temporary by an interior mutable `static` or a `static mut`
9292
9393error[E0764]: mutable borrows of temporaries that have their lifetime extended until the end of the program are not allowed
9494 --> $DIR/mut_ref_in_final.rs:73:54
9595 |
9696LL | static RAW_MUT_COERCE_S: SyncPtr<i32> = SyncPtr { x: &mut 0 };
9797 | ^^^^^^ this mutable borrow refers to such a temporary
9898 |
99- = note: Temporaries in constants and statics can have their lifetime extended until the end of the program
100- = note: To avoid accidentally creating global mutable state, such temporaries must be immutable
101- = help: If you really want global mutable state, try replacing the temporary by an interior mutable `static` or a `static mut`
99+ = note: temporaries in constants and statics can have their lifetime extended until the end of the program
100+ = note: to avoid accidentally creating global mutable state, such temporaries must be immutable
101+ = help: if you really want global mutable state, try replacing the temporary by an interior mutable `static` or a `static mut`
102102
103103error[E0764]: mutable borrows of temporaries that have their lifetime extended until the end of the program are not allowed
104104 --> $DIR/mut_ref_in_final.rs:75:52
105105 |
106106LL | const RAW_MUT_CAST_C: SyncPtr<i32> = SyncPtr { x : &mut 42 as *mut _ as *const _ };
107107 | ^^^^^^^ this mutable borrow refers to such a temporary
108108 |
109- = note: Temporaries in constants and statics can have their lifetime extended until the end of the program
110- = note: To avoid accidentally creating global mutable state, such temporaries must be immutable
111- = help: If you really want global mutable state, try replacing the temporary by an interior mutable `static` or a `static mut`
109+ = note: temporaries in constants and statics can have their lifetime extended until the end of the program
110+ = note: to avoid accidentally creating global mutable state, such temporaries must be immutable
111+ = help: if you really want global mutable state, try replacing the temporary by an interior mutable `static` or a `static mut`
112112
113113error[E0764]: mutable borrows of temporaries that have their lifetime extended until the end of the program are not allowed
114114 --> $DIR/mut_ref_in_final.rs:77:53
115115 |
116116LL | const RAW_MUT_COERCE_C: SyncPtr<i32> = SyncPtr { x: &mut 0 };
117117 | ^^^^^^ this mutable borrow refers to such a temporary
118118 |
119- = note: Temporaries in constants and statics can have their lifetime extended until the end of the program
120- = note: To avoid accidentally creating global mutable state, such temporaries must be immutable
121- = help: If you really want global mutable state, try replacing the temporary by an interior mutable `static` or a `static mut`
119+ = note: temporaries in constants and statics can have their lifetime extended until the end of the program
120+ = note: to avoid accidentally creating global mutable state, such temporaries must be immutable
121+ = help: if you really want global mutable state, try replacing the temporary by an interior mutable `static` or a `static mut`
122122
123123error[E0080]: constructing invalid value at .<enum-variant(Some)>.0: encountered a dangling reference (0x2a[noalloc] has no provenance)
124124 --> $DIR/mut_ref_in_final.rs:86:5
0 commit comments