]>
Commit | Line | Data |
---|---|---|
1b1a35ee XL |
1 | error[E0658]: mutable references are not allowed in constant functions |
2 | --> $DIR/const_let_assign3.rs:8:18 | |
0731742a | 3 | | |
1b1a35ee XL |
4 | LL | const fn foo(&mut self, x: u32) { |
5 | | ^^^^^^^^^ | |
f9f354fc | 6 | | |
1b1a35ee | 7 | = note: see issue #57349 <https://github.com/rust-lang/rust/issues/57349> for more information |
f9f354fc | 8 | = help: add `#![feature(const_mut_refs)]` to the crate attributes to enable |
0731742a | 9 | |
f035d41b | 10 | error[E0764]: mutable references are not allowed in constants |
a1dfa0c6 XL |
11 | --> $DIR/const_let_assign3.rs:16:5 |
12 | | | |
532ac7d7 | 13 | LL | s.foo(3); |
f035d41b | 14 | | ^ `&mut` is only allowed in `const fn` |
a1dfa0c6 | 15 | |
f035d41b | 16 | error[E0764]: mutable references are not allowed in constants |
0731742a XL |
17 | --> $DIR/const_let_assign3.rs:22:13 |
18 | | | |
19 | LL | let y = &mut x; | |
f035d41b | 20 | | ^^^^^^ `&mut` is only allowed in `const fn` |
0731742a | 21 | |
1b1a35ee | 22 | error: aborting due to 3 previous errors |
a1dfa0c6 | 23 | |
1b1a35ee XL |
24 | Some errors have detailed explanations: E0658, E0764. |
25 | For more information about an error, try `rustc --explain E0658`. |