Closed
Description
This program causes an internal compiler error:
fn new<T>() -> &'static T {
fail!("placeholder")
}
fn main() {
let &v = new();
}
I get this error, when compiling it:
error: internal compiler error: ty_region() invoked on in appropriate ty: &ty_err
- The problem disappears, if I force the type of v.
- A more reasonable error message appears if I write
let v = new();
instead. - It remains, if I replace the signature with
fn new<'r, T>() -> &'r T
. - It also remain if I replace the type signature with
fn new<T>() -> Option<&'static T>
and altermain
accordingly.
Metadata
Metadata
Assignees
Labels
No labels