mirror of
https://github.com/rust-lang/rust.git
synced 2025-10-27 11:05:06 +00:00
18 lines
300 B
Rust
18 lines
300 B
Rust
const fn mutable_ref_in_const() -> u8 {
|
|
let mut a = 0;
|
|
let b = &mut a; //~ ERROR mutable references
|
|
*b
|
|
}
|
|
|
|
struct X;
|
|
|
|
impl X {
|
|
const fn inherent_mutable_ref_in_const() -> u8 {
|
|
let mut a = 0;
|
|
let b = &mut a; //~ ERROR mutable references
|
|
*b
|
|
}
|
|
}
|
|
|
|
fn main() {}
|