rust/tests/ui/consts/min_const_fn/mutable_borrow.rs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

18 lines
300 B
Rust
Raw Normal View History

2018-11-23 08:30:10 -06:00
const fn mutable_ref_in_const() -> u8 {
let mut a = 0;
2020-09-23 23:05:59 -05:00
let b = &mut a; //~ ERROR mutable references
2018-11-23 08:30:10 -06:00
*b
}
struct X;
impl X {
const fn inherent_mutable_ref_in_const() -> u8 {
let mut a = 0;
2020-09-23 23:05:59 -05:00
let b = &mut a; //~ ERROR mutable references
2018-11-23 08:30:10 -06:00
*b
}
}
fn main() {}