2018-11-23 08:30:10 -06:00
|
|
|
const fn mutable_ref_in_const() -> u8 {
|
2018-12-28 13:05:22 -06:00
|
|
|
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 {
|
2018-12-28 13:05:22 -06:00
|
|
|
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() {}
|