@@ -12,7 +12,7 @@ const A: *const i32 = &4;
1212// It could be made sound to allow it to compile,
1313// but we do not want to allow this to compile,
1414// as that would be an enormous footgun in oli-obk's opinion.
15- const B : * mut i32 = & mut 4 ; //~ ERROR mutable references are not allowed
15+ const B : * mut i32 = & mut 4 ; //~ ERROR mutable borrows of lifetime-extended temporaries
1616
1717// Ok, no actual mutable allocation exists
1818const B2 : Option < & mut i32 > = None ;
@@ -29,7 +29,7 @@ const IMMUT_MUT_REF: &mut u16 = unsafe { mem::transmute(&13) };
2929static IMMUT_MUT_REF_STATIC : & mut u16 = unsafe { mem:: transmute ( & 13 ) } ;
3030//~^ ERROR pointing to read-only memory
3131
32- // Ok, because no references to mutable data exist here, since the `{}` moves
32+ // Ok, because no borrows of mutable data exist here, since the `{}` moves
3333// its value and then takes a reference to that.
3434const C : * const i32 = & {
3535 let mut x = 42 ;
@@ -69,13 +69,13 @@ unsafe impl<T> Sync for SyncPtr<T> {}
6969// (This relies on `SyncPtr` being a curly brace struct.)
7070// However, we intern the inner memory as read-only, so this must be rejected.
7171static RAW_MUT_CAST_S : SyncPtr < i32 > = SyncPtr { x : & mut 42 as * mut _ as * const _ } ;
72- //~^ ERROR mutable references are not allowed
72+ //~^ ERROR mutable borrows of lifetime-extended temporaries
7373static RAW_MUT_COERCE_S : SyncPtr < i32 > = SyncPtr { x : & mut 0 } ;
74- //~^ ERROR mutable references are not allowed
74+ //~^ ERROR mutable borrows of lifetime-extended temporaries
7575const RAW_MUT_CAST_C : SyncPtr < i32 > = SyncPtr { x : & mut 42 as * mut _ as * const _ } ;
76- //~^ ERROR mutable references are not allowed
76+ //~^ ERROR mutable borrows of lifetime-extended temporaries
7777const RAW_MUT_COERCE_C : SyncPtr < i32 > = SyncPtr { x : & mut 0 } ;
78- //~^ ERROR mutable references are not allowed
78+ //~^ ERROR mutable borrows of lifetime-extended temporaries
7979
8080fn main ( ) {
8181 println ! ( "{}" , unsafe { * A } ) ;
0 commit comments