@@ -108,7 +108,7 @@ fn drop_after_sharing() {
108108
109109// Make sure that coercing &mut T to *const T produces a writeable pointer.
110110fn direct_mut_to_const_raw ( ) {
111- // FIXME : This is currently disabled, waiting on a fix for <https://github.com/rust-lang/rust/issues/56604>
111+ // TODO : This is currently disabled, waiting on a decision on <https://github.com/rust-lang/rust/issues/56604>
112112 /*let x = &mut 0;
113113 let y: *const i32 = x;
114114 unsafe { *(y as *mut i32) = 1; }
@@ -119,26 +119,21 @@ fn direct_mut_to_const_raw() {
119119// Make sure that we can create two raw pointers from a mutable reference and use them both.
120120fn two_raw ( ) { unsafe {
121121 let x = & mut 0 ;
122- // Given the implicit reborrows, the only reason this currently works is that we
123- // do not track raw pointers: The creation of `y2` reborrows `x` and thus pops
124- // `y1` off the stack.
125122 let y1 = x as * mut _ ;
126123 let y2 = x as * mut _ ;
127124 * y1 += 2 ;
128125 * y2 += 1 ;
129126} }
130127
131128// Make sure that creating a *mut does not invalidate existing shared references.
132- fn shr_and_raw ( ) { /* unsafe {
129+ fn shr_and_raw ( ) { unsafe {
133130 use std:: mem;
134- // FIXME: This is currently disabled because "as *mut _" incurs a reborrow.
135131 let x = & mut 0 ;
136132 let y1: & i32 = mem:: transmute ( & * x) ; // launder lifetimes
137133 let y2 = x as * mut _ ;
138134 let _val = * y1;
139135 * y2 += 1 ;
140- // TODO: Once this works, add compile-fail test that tries to read from y1 again.
141- } */ }
136+ } }
142137
143138fn disjoint_mutable_subborrows ( ) {
144139 struct Foo {
@@ -165,5 +160,5 @@ fn disjoint_mutable_subborrows() {
165160 let b = unsafe { borrow_field_b ( ptr) } ;
166161 b. push ( 4 ) ;
167162 a. push_str ( " world" ) ;
168- dbg ! ( a , b) ;
163+ eprintln ! ( "{:?} {:?}" , a , b) ;
169164}
0 commit comments