]>
Commit | Line | Data |
---|---|---|
0731742a XL |
1 | const fn mutable_ref_in_const() -> u8 { |
2 | let mut a = 0; | |
1b1a35ee | 3 | let b = &mut a; //~ ERROR mutable references |
0731742a XL |
4 | *b |
5 | } | |
6 | ||
7 | struct X; | |
8 | ||
9 | impl X { | |
10 | const fn inherent_mutable_ref_in_const() -> u8 { | |
11 | let mut a = 0; | |
1b1a35ee | 12 | let b = &mut a; //~ ERROR mutable references |
0731742a XL |
13 | *b |
14 | } | |
15 | } | |
16 | ||
17 | fn main() {} |