-// We fail to detect this when neither this nor libstd are optimized/have retagging.
-// FIXME: Investigate that.
-// compile-flags: -Zmir-opt-level=0
-
#![allow(unused_variables)]
fn main() {
-#![allow(unused_variables)]
-
static mut PTR: *mut u8 = 0 as *mut _;
fn fun1(x: &mut u8) {
}
fn main() {
- let val = &mut 0; // FIXME: This should also work with a local variable, but currently it does not.
+ let mut val = 0;
+ let val = &mut val;
fun1(val);
*val = 2; // this invalidates any raw ptrs `fun1` might have created.
fun2(); // if they now use a raw ptr they break our reference
flags.push("-Zmir-opt-level=1".to_owned());
}
if !have_fullmir() {
- // Validation relies on the EscapeToRaw statements being emitted
+ // FIXME: Validation relies on the EscapeToRaw statements being emitted
flags.push("-Zmiri-disable-validation".to_owned());
}
let f2 : Box<Fat<[isize]>> = f1;
foo(&*f2);
- // FIXME (#22405): Replace `Box::new` with `box` here when/if possible.
let f3 : Box<Fat<[isize]>> =
Box::<Fat<[_; 3]>>::new(Fat { f1: 5, f2: "some str", ptr: [1, 2, 3] });
foo(&*f3);
+ let f4 : Box<Fat<[isize]>> = box Fat { f1: 5, f2: "some str", ptr: [1, 2, 3] };
+ foo(&*f4);
}
-// FIXME(solson): 32-bit mode doesn't test anything currently.
-#![cfg_attr(target_pointer_width = "32", allow(dead_code))]
-
#[derive(Debug, PartialEq)]
enum Unit { Unit(()) } // Force non-C-enum representation.
&[ref head, ref tail..] =>
foldl(tail, function(initial, head), function),
&[] => {
- // FIXME: call guards
let res = initial.clone(); res
}
}
&[ref head.., ref tail] =>
foldr(head, function(tail, initial), function),
&[] => {
- // FIXME: call guards
let res = initial.clone(); res
}
}