diff --git a/tests/compile-fail/ctlz_nonzero.rs b/tests/compile-fail/ctlz_nonzero.rs index 4e2ccd0ac508..86fd5ec46c20 100644 --- a/tests/compile-fail/ctlz_nonzero.rs +++ b/tests/compile-fail/ctlz_nonzero.rs @@ -8,7 +8,7 @@ mod rusti { pub fn main() { unsafe { - use rusti::*; + use crate::rusti::*; ctlz_nonzero(0u8); //~ ERROR constant evaluation error: ctlz_nonzero called on 0 } diff --git a/tests/compile-fail/cttz_nonzero.rs b/tests/compile-fail/cttz_nonzero.rs index 50b8df619982..a6c3b03cfb5c 100644 --- a/tests/compile-fail/cttz_nonzero.rs +++ b/tests/compile-fail/cttz_nonzero.rs @@ -8,7 +8,7 @@ mod rusti { pub fn main() { unsafe { - use rusti::*; + use crate::rusti::*; cttz_nonzero(0u8); //~ ERROR constant evaluation error: cttz_nonzero called on 0 } diff --git a/tests/compiletest.rs b/tests/compiletest.rs index 7ecf64590b61..7aa55ef66340 100644 --- a/tests/compiletest.rs +++ b/tests/compiletest.rs @@ -62,6 +62,7 @@ fn compile_fail(sysroot: &Path, path: &str, target: &str, host: &str, need_fullm let mut flags = Vec::new(); flags.push(format!("--sysroot {}", sysroot.display())); flags.push("-Dwarnings -Dunused".to_owned()); // overwrite the -Aunused in compiletest-rs + flags.push("--edition 2018".to_owned()); if opt { // Optimizing too aggressivley makes UB detection harder, but test at least // the default value. @@ -98,6 +99,7 @@ fn miri_pass(sysroot: &Path, path: &str, target: &str, host: &str, need_fullmir: let mut flags = Vec::new(); flags.push(format!("--sysroot {}", sysroot.display())); flags.push("-Dwarnings -Dunused".to_owned()); // overwrite the -Aunused in compiletest-rs + flags.push("--edition 2018".to_owned()); if opt { // FIXME: We use opt level 1 because MIR inlining defeats the validation // whitelist. diff --git a/tests/run-pass-fullmir/foreign-fn-linkname.rs b/tests/run-pass-fullmir/foreign-fn-linkname.rs index 789e3eccceb7..b61cfa84ef75 100644 --- a/tests/run-pass-fullmir/foreign-fn-linkname.rs +++ b/tests/run-pass-fullmir/foreign-fn-linkname.rs @@ -9,14 +9,16 @@ // except according to those terms. //ignore-windows: Uses POSIX APIs -#![feature(libc)] + +#![feature(libc, extern_crate_item_prelude)] +#![allow(unused_extern_crates)] // rustc bug https://github.com/rust-lang/rust/issues/56098 extern crate libc; + use std::ffi::CString; mod mlibc { use libc::{c_char, size_t}; - extern { #[link_name = "strlen"] pub fn my_strlen(str: *const c_char) -> size_t; diff --git a/tests/run-pass-fullmir/memchr.rs b/tests/run-pass-fullmir/memchr.rs index 36eb85dcf7e8..2f5e2c4bb739 100644 --- a/tests/run-pass-fullmir/memchr.rs +++ b/tests/run-pass-fullmir/memchr.rs @@ -1,6 +1,5 @@ #![feature(slice_internals)] -extern crate core; use core::slice::memchr::{memchr, memrchr}; // test fallback implementations on all platforms diff --git a/tests/run-pass/intrinsics-integer.rs b/tests/run-pass/intrinsics-integer.rs index 4896f02da20b..de59314eff5a 100644 --- a/tests/run-pass/intrinsics-integer.rs +++ b/tests/run-pass/intrinsics-integer.rs @@ -23,7 +23,7 @@ mod rusti { pub fn main() { unsafe { - use rusti::*; + use crate::rusti::*; assert_eq!(ctpop(0u8), 0); assert_eq!(ctpop(0i8), 0); assert_eq!(ctpop(0u16), 0); assert_eq!(ctpop(0i16), 0); diff --git a/tests/run-pass/stacked-borrows.rs b/tests/run-pass/stacked-borrows.rs index 7b7a7c9be203..72f26763be14 100644 --- a/tests/run-pass/stacked-borrows.rs +++ b/tests/run-pass/stacked-borrows.rs @@ -68,13 +68,11 @@ fn mut_shr_raw() { // That should work. fn mut_raw_then_mut_shr() { let mut x = 2; - { - let xref = &mut x; - let xraw = &mut *xref as *mut _; - let xshr = &*xref; - assert_eq!(*xshr, 2); - unsafe { *xraw = 4; } - } + let xref = &mut x; + let xraw = &mut *xref as *mut _; + let xshr = &*xref; + assert_eq!(*xshr, 2); + unsafe { *xraw = 4; } assert_eq!(x, 4); }