stabilize raw_ref_op
This commit is contained in:
parent
f04f6ca36d
commit
79503dd742
63 changed files with 106 additions and 246 deletions
|
@ -3,7 +3,6 @@ The address of temporary value was taken.
|
|||
Erroneous code example:
|
||||
|
||||
```compile_fail,E0745
|
||||
# #![feature(raw_ref_op)]
|
||||
fn temp_address() {
|
||||
let ptr = &raw const 2; // error!
|
||||
}
|
||||
|
@ -15,7 +14,6 @@ In this example, `2` is destroyed right after the assignment, which means that
|
|||
To avoid this error, first bind the temporary to a named local variable:
|
||||
|
||||
```
|
||||
# #![feature(raw_ref_op)]
|
||||
fn temp_address() {
|
||||
let val = 2;
|
||||
let ptr = &raw const val; // ok!
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue