rust/tests/ui/consts/const-mut-refs/feature-gate-const_mut_refs.rs
2023-01-11 09:32:08 +00:00

9 lines
110 B
Rust

fn main() {
foo(&mut 5);
}
const fn foo(x: &mut i32) -> i32 { //~ ERROR mutable references
*x + 1
}