Add test for unreachable well-formedness.

This commit adds a test for checking that types are well-formed when
unreachable.
This commit is contained in:
David Wood 2018-11-23 11:55:09 +01:00
parent f2532012dd
commit b182a21163
No known key found for this signature in database
GPG Key ID: 01760B4F9F53F154
2 changed files with 18 additions and 0 deletions

View File

@ -0,0 +1,7 @@
fn foo<T: 'static>() { }
fn main<'a>() {
return;
let x = foo::<&'a u32>();
}

View File

@ -0,0 +1,11 @@
error[E0477]: the type `&'a u32` does not fulfill the required lifetime
--> $DIR/issue-54943.rs:6:13
|
LL | let x = foo::<&'a u32>();
| ^^^^^^^^^^^^^^
|
= note: type must satisfy the static lifetime
error: aborting due to previous error
For more information about this error, try `rustc --explain E0477`.