1
Fork 0

stabilize raw_ref_op

This commit is contained in:
Ralf Jung 2024-07-13 13:53:56 +02:00
parent f04f6ca36d
commit 79503dd742
63 changed files with 106 additions and 246 deletions

View file

@ -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!