Merge pull request #559 from RalfJung/fixme

remove/fix outdated FIXMEs in tests
This commit is contained in:
Ralf Jung 2018-12-03 11:48:41 +01:00 committed by GitHub
commit 173ad363a0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
20 changed files with 14 additions and 54 deletions

View File

@ -1,5 +1,3 @@
#![allow(unused_variables)]
// This makes a ref that was passed to us via &mut alias with things it should not alias with
fn retarget(x: &mut &u32, target: &mut u32) {
unsafe { *x = &mut *(target as *mut _); }

View File

@ -1,8 +1,6 @@
#![allow(unused_variables)]
use std::mem;
pub fn safe(x: &mut i32, y: &mut i32) {} //~ ERROR barrier
pub fn safe(_x: &mut i32, _y: &mut i32) {} //~ ERROR barrier
fn main() {
let mut x = 0;

View File

@ -1,8 +1,6 @@
#![allow(unused_variables)]
use std::mem;
pub fn safe(x: &i32, y: &mut i32) {} //~ ERROR barrier
pub fn safe(_x: &i32, _y: &mut i32) {} //~ ERROR barrier
fn main() {
let mut x = 0;

View File

@ -1,8 +1,6 @@
#![allow(unused_variables)]
use std::mem;
pub fn safe(x: &mut i32, y: &i32) {} //~ ERROR does not exist on the stack
pub fn safe(_x: &mut i32, _y: &i32) {} //~ ERROR does not exist on the stack
fn main() {
let mut x = 0;

View File

@ -1,10 +1,8 @@
#![allow(unused_variables)]
use std::mem;
use std::cell::Cell;
// Make sure &mut UnsafeCell also is exclusive
pub fn safe(x: &i32, y: &mut Cell<i32>) {} //~ ERROR barrier
pub fn safe(_x: &i32, _y: &mut Cell<i32>) {} //~ ERROR barrier
fn main() {
let mut x = 0;

View File

@ -1,5 +1,3 @@
#![allow(unused_variables)]
mod safe {
use std::slice::from_raw_parts_mut;

View File

@ -1,9 +1,3 @@
// 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() {
let target = &mut 42;
let target2 = target as *mut _;

View File

@ -1,5 +1,3 @@
#![allow(unused_variables)]
static mut PTR: *mut u8 = 0 as *mut _;
fn fun1(x: &mut u8) {
@ -14,7 +12,8 @@ fn fun2() {
}
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

View File

@ -2,17 +2,12 @@
// compile-flags: -Zmiri-disable-validation
#![feature(never_type)]
#![allow(unreachable_code)]
#![allow(unused_variables)]
struct Human;
fn main() {
let x: ! = unsafe {
let _x: ! = unsafe {
std::mem::transmute::<Human, !>(Human) //~ ERROR constant evaluation error
//^~ NOTE entered unreachable code
};
f(x)
}
fn f(x: !) -> ! { x }

View File

@ -2,8 +2,6 @@
// compile-flags: -Zmiri-disable-validation
#![feature(never_type)]
#![allow(unreachable_code)]
#![allow(unused_variables)]
enum Void {}

View File

@ -1,5 +1,3 @@
#![allow(unused_variables)]
#[repr(u32)]
enum Bool { True }

View File

@ -106,7 +106,7 @@ fn miri_pass(sysroot: &Path, path: &str, target: &str, host: &str, need_fullmir:
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());
}

View File

@ -8,8 +8,6 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
#![allow(unused_features)]
#![feature(box_syntax)]
struct Fat<T: ?Sized> {
@ -127,8 +125,9 @@ pub fn main() {
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);
}

View File

@ -8,8 +8,6 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
#![allow(unused_variables)]
#[derive(Clone, Copy, Debug)]
struct Bar;
@ -25,5 +23,5 @@ impl Biz {
}
fn main() {
let foo = Biz::BAZ;
let _foo = Biz::BAZ;
}

View File

@ -1,5 +1,4 @@
// Make sure validation can handle many overlapping shared borrows for different parts of a data structure
#![allow(unused_variables)]
use std::cell::RefCell;
struct Test {
@ -25,9 +24,9 @@ fn test2(r: &mut RefCell<i32>) {
let x = &*r; // releasing write lock, first suspension recorded
let mut x_ref = x.borrow_mut();
let x_inner : &mut i32 = &mut *x_ref; // new inner write lock, with same lifetime as outer lock
let x_inner_shr = &*x_inner; // releasing inner write lock, recording suspension
let y = &*r; // second suspension for the outer write lock
let x_inner_shr2 = &*x_inner; // 2nd suspension for inner write lock
let _x_inner_shr = &*x_inner; // releasing inner write lock, recording suspension
let _y = &*r; // second suspension for the outer write lock
let _x_inner_shr2 = &*x_inner; // 2nd suspension for inner write lock
}
fn main() {

View File

@ -8,7 +8,6 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
#![allow(unused_features, unused_variables)]
#![feature(box_syntax)]
fn test(foo: Box<Vec<isize>> ) { assert_eq!((*foo)[0], 10); }

View File

@ -8,7 +8,6 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
#![allow(unused_features, unused_variables)]
#![feature(box_syntax)]
pub fn main() {

View File

@ -22,7 +22,6 @@
// doing region-folding, when really all clients of the region-folding
// case only want to see FREE lifetime variables, not bound ones.
#![allow(unused_features)]
#![feature(box_syntax)]
pub fn main() {

View File

@ -1,6 +1,3 @@
// 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.

View File

@ -22,7 +22,6 @@ fn foldl<T, U, F>(values: &[T],
&[ref head, ref tail..] =>
foldl(tail, function(initial, head), function),
&[] => {
// FIXME: call guards
let res = initial.clone(); res
}
}
@ -39,7 +38,6 @@ fn foldr<T, U, F>(values: &[T],
&[ref head.., ref tail] =>
foldr(head, function(tail, initial), function),
&[] => {
// FIXME: call guards
let res = initial.clone(); res
}
}