@@ -108,7 +108,7 @@ fn drop_after_sharing() {
108
108
109
109
// Make sure that coercing &mut T to *const T produces a writeable pointer.
110
110
fn 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>
112
112
/*let x = &mut 0;
113
113
let y: *const i32 = x;
114
114
unsafe { *(y as *mut i32) = 1; }
@@ -119,26 +119,21 @@ fn direct_mut_to_const_raw() {
119
119
// Make sure that we can create two raw pointers from a mutable reference and use them both.
120
120
fn two_raw ( ) { unsafe {
121
121
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.
125
122
let y1 = x as * mut _ ;
126
123
let y2 = x as * mut _ ;
127
124
* y1 += 2 ;
128
125
* y2 += 1 ;
129
126
} }
130
127
131
128
// Make sure that creating a *mut does not invalidate existing shared references.
132
- fn shr_and_raw ( ) { /* unsafe {
129
+ fn shr_and_raw ( ) { unsafe {
133
130
use std:: mem;
134
- // FIXME: This is currently disabled because "as *mut _" incurs a reborrow.
135
131
let x = & mut 0 ;
136
132
let y1: & i32 = mem:: transmute ( & * x) ; // launder lifetimes
137
133
let y2 = x as * mut _ ;
138
134
let _val = * y1;
139
135
* y2 += 1 ;
140
- // TODO: Once this works, add compile-fail test that tries to read from y1 again.
141
- } */ }
136
+ } }
142
137
143
138
fn disjoint_mutable_subborrows ( ) {
144
139
struct Foo {
@@ -165,5 +160,5 @@ fn disjoint_mutable_subborrows() {
165
160
let b = unsafe { borrow_field_b ( ptr) } ;
166
161
b. push ( 4 ) ;
167
162
a. push_str ( " world" ) ;
168
- dbg ! ( a , b) ;
163
+ eprintln ! ( "{:?} {:?}" , a , b) ;
169
164
}
0 commit comments