add FIXME related to ref x bindings
This commit is contained in:
parent
2b6f9664ed
commit
df37678b76
3 changed files with 16 additions and 14 deletions
|
|
@ -20,7 +20,7 @@ fn ref_with_ascribed_static_type() -> u32 {
|
|||
// Check the behavior in some wacky cases.
|
||||
let x = 22;
|
||||
let y = &x; //~ ERROR
|
||||
let ref z: &'static u32 = y; //~ ERROR
|
||||
let ref z: &'static u32 = y;
|
||||
**z
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -19,17 +19,6 @@ LL | }
|
|||
|
|
||||
= note: borrowed value must be valid for the static lifetime...
|
||||
|
||||
error[E0597]: `y` does not live long enough
|
||||
--> $DIR/patterns.rs:23:9
|
||||
|
|
||||
LL | let ref z: &'static u32 = y; //~ ERROR
|
||||
| ^^^^^ borrowed value does not live long enough
|
||||
LL | **z
|
||||
LL | }
|
||||
| - `y` dropped here while still borrowed
|
||||
|
|
||||
= note: borrowed value must be valid for the static lifetime...
|
||||
|
||||
error[E0597]: `x` does not live long enough
|
||||
--> $DIR/patterns.rs:46:27
|
||||
|
|
||||
|
|
@ -149,6 +138,6 @@ LL | fn a_to_static_then_static<'a>(x: &'a u32) -> &'static u32 {
|
|||
LL | let (y, _z): (&'static u32, u32) = (x, 44); //~ ERROR
|
||||
| ^^^^^^^ requires that `'a` must outlive `'static`
|
||||
|
||||
error: aborting due to 15 previous errors
|
||||
error: aborting due to 14 previous errors
|
||||
|
||||
For more information about this error, try `rustc --explain E0597`.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue