]> git.lizzy.rs Git - rust.git/commitdiff
use 2018 edition for tests
authorRalf Jung <post@ralfj.de>
Tue, 20 Nov 2018 11:41:34 +0000 (12:41 +0100)
committerRalf Jung <post@ralfj.de>
Tue, 20 Nov 2018 11:41:34 +0000 (12:41 +0100)
tests/compiletest.rs
tests/run-pass/stacked-borrows.rs

index 7ecf64590b6148fd2af5e57f0bb89ceb76a96c7e..7aa55ef6634081dc7d7ca3105675cd28b1a3b2fc 100644 (file)
@@ -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.
index 7b7a7c9be2030b50dc6c9f0244b42845e67c6b8f..72f26763be14094ff32e9c9d4517f2cff91f8425 100644 (file)
@@ -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);
 }