summaryrefslogtreecommitdiffstats
path: root/tests/ui/consts/min_const_fn/mutable_borrow.rs
blob: 580b1d50f774e4923825905e2d8c7cf66dedfbe5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
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() {}