stabilize const_mut_refs
This commit is contained in:
parent
4f1be92153
commit
3175cc2814
152 changed files with 286 additions and 1376 deletions
|
@ -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;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue