Closed
Description
STR
fn foo<'a>(v: *const &'a ()) {
let v: *const &'static () = v as *const &'static ();
}
fn main() {}
Expected result
cast will be successful
Actual Result
<anon>:2:33: 2:34 error: mismatched types:
expected `*const &'static ()`,
found `*const &'a ()`
(lifetime mismatch) [E0308]
<anon>:2 let v: *const &'static () = v as *const &'static ();
^
<anon>:2:33: 2:34 help: see the detailed explanation for E0308
<anon>:1:30: 3:2 note: the lifetime 'a as defined on the block at 1:29...
<anon>:1 fn foo<'a>(v: *const &'a ()) {
<anon>:2 let v: *const &'static () = v as *const &'static ();
<anon>:3 }
note: ...does not necessarily outlive the static lifetime
error: aborting due to previous error
playpen: application terminated with error code 101