Skip to content

Commit 173ad36

Browse files
authored
Merge pull request #559 from RalfJung/fixme
remove/fix outdated FIXMEs in tests
2 parents 5bde40c + 0cb3bf7 commit 173ad36

20 files changed

+14
-54
lines changed

Diff for: tests/compile-fail-fullmir/stacked_borrows/alias_through_mutation.rs

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

Diff for: tests/compile-fail-fullmir/stacked_borrows/aliasing_mut1.rs

+1-3
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
1-
#![allow(unused_variables)]
2-
31
use std::mem;
42

5-
pub fn safe(x: &mut i32, y: &mut i32) {} //~ ERROR barrier
3+
pub fn safe(_x: &mut i32, _y: &mut i32) {} //~ ERROR barrier
64

75
fn main() {
86
let mut x = 0;

Diff for: tests/compile-fail-fullmir/stacked_borrows/aliasing_mut2.rs

+1-3
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
1-
#![allow(unused_variables)]
2-
31
use std::mem;
42

5-
pub fn safe(x: &i32, y: &mut i32) {} //~ ERROR barrier
3+
pub fn safe(_x: &i32, _y: &mut i32) {} //~ ERROR barrier
64

75
fn main() {
86
let mut x = 0;

Diff for: tests/compile-fail-fullmir/stacked_borrows/aliasing_mut3.rs

+1-3
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
1-
#![allow(unused_variables)]
2-
31
use std::mem;
42

5-
pub fn safe(x: &mut i32, y: &i32) {} //~ ERROR does not exist on the stack
3+
pub fn safe(_x: &mut i32, _y: &i32) {} //~ ERROR does not exist on the stack
64

75
fn main() {
86
let mut x = 0;

Diff for: tests/compile-fail-fullmir/stacked_borrows/aliasing_mut4.rs

+1-3
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,8 @@
1-
#![allow(unused_variables)]
2-
31
use std::mem;
42
use std::cell::Cell;
53

64
// Make sure &mut UnsafeCell also is exclusive
7-
pub fn safe(x: &i32, y: &mut Cell<i32>) {} //~ ERROR barrier
5+
pub fn safe(_x: &i32, _y: &mut Cell<i32>) {} //~ ERROR barrier
86

97
fn main() {
108
let mut x = 0;

Diff for: tests/compile-fail-fullmir/stacked_borrows/buggy_split_at_mut.rs

-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
#![allow(unused_variables)]
2-
31
mod safe {
42
use std::slice::from_raw_parts_mut;
53

Diff for: tests/compile-fail-fullmir/stacked_borrows/illegal_write2.rs

-6
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,3 @@
1-
// We fail to detect this when neither this nor libstd are optimized/have retagging.
2-
// FIXME: Investigate that.
3-
// compile-flags: -Zmir-opt-level=0
4-
5-
#![allow(unused_variables)]
6-
71
fn main() {
82
let target = &mut 42;
93
let target2 = target as *mut _;

Diff for: tests/compile-fail-fullmir/stacked_borrows/pointer_smuggling.rs

+2-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
#![allow(unused_variables)]
2-
31
static mut PTR: *mut u8 = 0 as *mut _;
42

53
fn fun1(x: &mut u8) {
@@ -14,7 +12,8 @@ fn fun2() {
1412
}
1513

1614
fn main() {
17-
let val = &mut 0; // FIXME: This should also work with a local variable, but currently it does not.
15+
let mut val = 0;
16+
let val = &mut val;
1817
fun1(val);
1918
*val = 2; // this invalidates any raw ptrs `fun1` might have created.
2019
fun2(); // if they now use a raw ptr they break our reference

Diff for: tests/compile-fail/never_transmute_humans.rs

+1-6
Original file line numberDiff line numberDiff line change
@@ -2,17 +2,12 @@
22
// compile-flags: -Zmiri-disable-validation
33

44
#![feature(never_type)]
5-
#![allow(unreachable_code)]
6-
#![allow(unused_variables)]
75

86
struct Human;
97

108
fn main() {
11-
let x: ! = unsafe {
9+
let _x: ! = unsafe {
1210
std::mem::transmute::<Human, !>(Human) //~ ERROR constant evaluation error
1311
//^~ NOTE entered unreachable code
1412
};
15-
f(x)
1613
}
17-
18-
fn f(x: !) -> ! { x }

Diff for: tests/compile-fail/never_transmute_void.rs

-2
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@
22
// compile-flags: -Zmiri-disable-validation
33

44
#![feature(never_type)]
5-
#![allow(unreachable_code)]
6-
#![allow(unused_variables)]
75

86
enum Void {}
97

Diff for: tests/compile-fail/validity/transmute_through_ptr.rs

-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
#![allow(unused_variables)]
2-
31
#[repr(u32)]
42
enum Bool { True }
53

Diff for: tests/compiletest.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ fn miri_pass(sysroot: &Path, path: &str, target: &str, host: &str, need_fullmir:
106106
flags.push("-Zmir-opt-level=1".to_owned());
107107
}
108108
if !have_fullmir() {
109-
// Validation relies on the EscapeToRaw statements being emitted
109+
// FIXME: Validation relies on the EscapeToRaw statements being emitted
110110
flags.push("-Zmiri-disable-validation".to_owned());
111111
}
112112

Diff for: tests/run-pass/dst-struct.rs

+2-3
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,6 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11-
12-
#![allow(unused_features)]
1311
#![feature(box_syntax)]
1412

1513
struct Fat<T: ?Sized> {
@@ -127,8 +125,9 @@ pub fn main() {
127125
let f2 : Box<Fat<[isize]>> = f1;
128126
foo(&*f2);
129127

130-
// FIXME (#22405): Replace `Box::new` with `box` here when/if possible.
131128
let f3 : Box<Fat<[isize]>> =
132129
Box::<Fat<[_; 3]>>::new(Fat { f1: 5, f2: "some str", ptr: [1, 2, 3] });
133130
foo(&*f3);
131+
let f4 : Box<Fat<[isize]>> = box Fat { f1: 5, f2: "some str", ptr: [1, 2, 3] };
132+
foo(&*f4);
134133
}

Diff for: tests/run-pass/issue-31267-additional.rs

+1-3
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,6 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11-
#![allow(unused_variables)]
12-
1311
#[derive(Clone, Copy, Debug)]
1412
struct Bar;
1513

@@ -25,5 +23,5 @@ impl Biz {
2523
}
2624

2725
fn main() {
28-
let foo = Biz::BAZ;
26+
let _foo = Biz::BAZ;
2927
}

Diff for: tests/run-pass/many_shr_bor.rs

+3-4
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
// Make sure validation can handle many overlapping shared borrows for different parts of a data structure
2-
#![allow(unused_variables)]
32
use std::cell::RefCell;
43

54
struct Test {
@@ -25,9 +24,9 @@ fn test2(r: &mut RefCell<i32>) {
2524
let x = &*r; // releasing write lock, first suspension recorded
2625
let mut x_ref = x.borrow_mut();
2726
let x_inner : &mut i32 = &mut *x_ref; // new inner write lock, with same lifetime as outer lock
28-
let x_inner_shr = &*x_inner; // releasing inner write lock, recording suspension
29-
let y = &*r; // second suspension for the outer write lock
30-
let x_inner_shr2 = &*x_inner; // 2nd suspension for inner write lock
27+
let _x_inner_shr = &*x_inner; // releasing inner write lock, recording suspension
28+
let _y = &*r; // second suspension for the outer write lock
29+
let _x_inner_shr2 = &*x_inner; // 2nd suspension for inner write lock
3130
}
3231

3332
fn main() {

Diff for: tests/run-pass/move-arg-2-unique.rs

-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11-
#![allow(unused_features, unused_variables)]
1211
#![feature(box_syntax)]
1312

1413
fn test(foo: Box<Vec<isize>> ) { assert_eq!((*foo)[0], 10); }

Diff for: tests/run-pass/move-arg-3-unique.rs

-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11-
#![allow(unused_features, unused_variables)]
1211
#![feature(box_syntax)]
1312

1413
pub fn main() {

Diff for: tests/run-pass/regions-lifetime-nonfree-late-bound.rs

-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@
2222
// doing region-folding, when really all clients of the region-folding
2323
// case only want to see FREE lifetime variables, not bound ones.
2424

25-
#![allow(unused_features)]
2625
#![feature(box_syntax)]
2726

2827
pub fn main() {

Diff for: tests/run-pass/sums.rs

-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,3 @@
1-
// FIXME(solson): 32-bit mode doesn't test anything currently.
2-
#![cfg_attr(target_pointer_width = "32", allow(dead_code))]
3-
41
#[derive(Debug, PartialEq)]
52
enum Unit { Unit(()) } // Force non-C-enum representation.
63

Diff for: tests/run-pass/vec-matching-fold.rs

-2
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@ fn foldl<T, U, F>(values: &[T],
2222
&[ref head, ref tail..] =>
2323
foldl(tail, function(initial, head), function),
2424
&[] => {
25-
// FIXME: call guards
2625
let res = initial.clone(); res
2726
}
2827
}
@@ -39,7 +38,6 @@ fn foldr<T, U, F>(values: &[T],
3938
&[ref head.., ref tail] =>
4039
foldr(head, function(tail, initial), function),
4140
&[] => {
42-
// FIXME: call guards
4341
let res = initial.clone(); res
4442
}
4543
}

0 commit comments

Comments
 (0)