diff --git a/src/test/ui/consts/const-mut-refs/const_mut_refs.rs b/src/test/ui/consts/const-mut-refs/const_mut_refs.rs new file mode 100644 index 00000000000..60a69cb9f3f --- /dev/null +++ b/src/test/ui/consts/const-mut-refs/const_mut_refs.rs @@ -0,0 +1,15 @@ +// run-pass + +#![feature(const_mut_refs)] + +struct Foo { + x: usize +} + +const fn bar(foo: &mut Foo) -> usize { + foo.x + 1 +} + +fn main() { + let _: [(); bar(&mut Foo { x: 0 })] = [(); 1]; +} diff --git a/src/test/ui/consts/const-eval/feature-gate-const_fn_mut_refs.rs b/src/test/ui/consts/const-mut-refs/feature-gate-const_mut_refs.rs similarity index 100% rename from src/test/ui/consts/const-eval/feature-gate-const_fn_mut_refs.rs rename to src/test/ui/consts/const-mut-refs/feature-gate-const_mut_refs.rs diff --git a/src/test/ui/consts/const-eval/feature-gate-const_fn_mut_refs.stderr b/src/test/ui/consts/const-mut-refs/feature-gate-const_mut_refs.stderr similarity index 88% rename from src/test/ui/consts/const-eval/feature-gate-const_fn_mut_refs.stderr rename to src/test/ui/consts/const-mut-refs/feature-gate-const_mut_refs.stderr index 26a61d38f8c..4fae119f026 100644 --- a/src/test/ui/consts/const-eval/feature-gate-const_fn_mut_refs.stderr +++ b/src/test/ui/consts/const-mut-refs/feature-gate-const_mut_refs.stderr @@ -1,5 +1,5 @@ error[E0723]: mutable references in const fn are unstable - --> $DIR/feature-gate-const_fn_mut_refs.rs:5:14 + --> $DIR/feature-gate-const_mut_refs.rs:5:14 | LL | const fn foo(x: &mut i32) -> i32 { | ^ diff --git a/src/test/ui/consts/const_fn_mut_refs.rs b/src/test/ui/consts/const_fn_mut_refs.rs deleted file mode 100644 index 2263a130284..00000000000 --- a/src/test/ui/consts/const_fn_mut_refs.rs +++ /dev/null @@ -1,15 +0,0 @@ -// run-pass - -#![feature(const_mut_refs)] - -struct Foo { - x: i32 -} - -const fn bar(foo: &mut Foo) -> i32 { - foo.x + 1 -} - -fn main() { - assert_eq!(bar(&mut Foo{x: 0}), 1); -}