Skip to content

Commit 669b9ea

Browse files
authored
Merge pull request #535 from RalfJung/tests-edition-2018
Use edition 2018 for tests
2 parents 3cfaed2 + 22f11b8 commit 669b9ea

File tree

7 files changed

+14
-13
lines changed

7 files changed

+14
-13
lines changed

tests/compile-fail/ctlz_nonzero.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ mod rusti {
88

99
pub fn main() {
1010
unsafe {
11-
use rusti::*;
11+
use crate::rusti::*;
1212

1313
ctlz_nonzero(0u8); //~ ERROR constant evaluation error: ctlz_nonzero called on 0
1414
}

tests/compile-fail/cttz_nonzero.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ mod rusti {
88

99
pub fn main() {
1010
unsafe {
11-
use rusti::*;
11+
use crate::rusti::*;
1212

1313
cttz_nonzero(0u8); //~ ERROR constant evaluation error: cttz_nonzero called on 0
1414
}

tests/compiletest.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@ fn compile_fail(sysroot: &Path, path: &str, target: &str, host: &str, need_fullm
6262
let mut flags = Vec::new();
6363
flags.push(format!("--sysroot {}", sysroot.display()));
6464
flags.push("-Dwarnings -Dunused".to_owned()); // overwrite the -Aunused in compiletest-rs
65+
flags.push("--edition 2018".to_owned());
6566
if opt {
6667
// Optimizing too aggressivley makes UB detection harder, but test at least
6768
// the default value.
@@ -98,6 +99,7 @@ fn miri_pass(sysroot: &Path, path: &str, target: &str, host: &str, need_fullmir:
9899
let mut flags = Vec::new();
99100
flags.push(format!("--sysroot {}", sysroot.display()));
100101
flags.push("-Dwarnings -Dunused".to_owned()); // overwrite the -Aunused in compiletest-rs
102+
flags.push("--edition 2018".to_owned());
101103
if opt {
102104
// FIXME: We use opt level 1 because MIR inlining defeats the validation
103105
// whitelist.

tests/run-pass-fullmir/foreign-fn-linkname.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,16 @@
99
// except according to those terms.
1010

1111
//ignore-windows: Uses POSIX APIs
12-
#![feature(libc)]
12+
13+
#![feature(libc, extern_crate_item_prelude)]
14+
#![allow(unused_extern_crates)] // rustc bug https://github.com/rust-lang/rust/issues/56098
1315

1416
extern crate libc;
17+
1518
use std::ffi::CString;
1619

1720
mod mlibc {
1821
use libc::{c_char, size_t};
19-
2022
extern {
2123
#[link_name = "strlen"]
2224
pub fn my_strlen(str: *const c_char) -> size_t;

tests/run-pass-fullmir/memchr.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
#![feature(slice_internals)]
22

3-
extern crate core;
43
use core::slice::memchr::{memchr, memrchr};
54

65
// test fallback implementations on all platforms

tests/run-pass/intrinsics-integer.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ mod rusti {
2323

2424
pub fn main() {
2525
unsafe {
26-
use rusti::*;
26+
use crate::rusti::*;
2727

2828
assert_eq!(ctpop(0u8), 0); assert_eq!(ctpop(0i8), 0);
2929
assert_eq!(ctpop(0u16), 0); assert_eq!(ctpop(0i16), 0);

tests/run-pass/stacked-borrows.rs

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -68,13 +68,11 @@ fn mut_shr_raw() {
6868
// That should work.
6969
fn mut_raw_then_mut_shr() {
7070
let mut x = 2;
71-
{
72-
let xref = &mut x;
73-
let xraw = &mut *xref as *mut _;
74-
let xshr = &*xref;
75-
assert_eq!(*xshr, 2);
76-
unsafe { *xraw = 4; }
77-
}
71+
let xref = &mut x;
72+
let xraw = &mut *xref as *mut _;
73+
let xshr = &*xref;
74+
assert_eq!(*xshr, 2);
75+
unsafe { *xraw = 4; }
7876
assert_eq!(x, 4);
7977
}
8078

0 commit comments

Comments
 (0)