Skip to content

Commit 1ae536b

Browse files
committed
use 2018 edition for tests
1 parent 3cfaed2 commit 1ae536b

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

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/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)