blob: 15badea003736ebd785215dd2553f193fcc8cc16 [file] [log] [blame]
error[E0658]: mutable references are not allowed in constant functions
--> $DIR/const_let_assign3.rs:8:18
|
LL | const fn foo(&mut self, x: u32) {
| ^^^^^^^^^
|
= note: see issue #57349 <https://github.com/rust-lang/rust/issues/57349> for more information
= help: add `#![feature(const_mut_refs)]` to the crate attributes to enable
error[E0764]: mutable references are not allowed in constants
--> $DIR/const_let_assign3.rs:16:5
|
LL | s.foo(3);
| ^ `&mut` is only allowed in `const fn`
error[E0764]: mutable references are not allowed in constants
--> $DIR/const_let_assign3.rs:22:13
|
LL | let y = &mut x;
| ^^^^^^ `&mut` is only allowed in `const fn`
error[E0019]: constant contains unimplemented expression type
--> $DIR/const_let_assign3.rs:24:5
|
LL | *y = 42;
| ^^^^^^^
|
= help: add `#![feature(const_mut_refs)]` to the crate attributes to enable
error: aborting due to 4 previous errors
Some errors have detailed explanations: E0019, E0658, E0764.
For more information about an error, try `rustc --explain E0019`.