Skip to content

Commit de60f72

Browse files
committed
Move and rewrite tests to use &mut in constants
1 parent 1f420b9 commit de60f72

File tree

4 files changed

+16
-16
lines changed

4 files changed

+16
-16
lines changed
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
// run-pass
2+
3+
#![feature(const_mut_refs)]
4+
5+
struct Foo {
6+
x: usize
7+
}
8+
9+
const fn bar(foo: &mut Foo) -> usize {
10+
foo.x + 1
11+
}
12+
13+
fn main() {
14+
let _: [(); bar(&mut Foo { x: 0 })] = [(); 1];
15+
}

src/test/ui/consts/const-eval/feature-gate-const_fn_mut_refs.stderr renamed to src/test/ui/consts/const-mut-refs/feature-gate-const_mut_refs.stderr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
error[E0723]: mutable references in const fn are unstable
2-
--> $DIR/feature-gate-const_fn_mut_refs.rs:5:14
2+
--> $DIR/feature-gate-const_mut_refs.rs:5:14
33
|
44
LL | const fn foo(x: &mut i32) -> i32 {
55
| ^

src/test/ui/consts/const_fn_mut_refs.rs

Lines changed: 0 additions & 15 deletions
This file was deleted.

0 commit comments

Comments
 (0)