1
Fork 0

stabilize const_mut_refs

This commit is contained in:
Ralf Jung 2024-08-17 14:19:34 +02:00
parent 4f1be92153
commit 3175cc2814
152 changed files with 286 additions and 1376 deletions

View file

@ -3,8 +3,6 @@ A mutable reference was used in a constant.
Erroneous code example:
```compile_fail,E0764
#![feature(const_mut_refs)]
fn main() {
const OH_NO: &'static mut usize = &mut 1; // error!
}
@ -26,8 +24,6 @@ Remember: you cannot use a function call inside a constant or static. However,
you can totally use it in constant functions:
```
#![feature(const_mut_refs)]
const fn foo(x: usize) -> usize {
let mut y = 1;
let z = &mut y;