Skip to content

Commit

Permalink
Add test for unreachable well-formedness.
Browse files Browse the repository at this point in the history
This commit adds a test for checking that types are well-formed when
unreachable.
  • Loading branch information
davidtwco committed Dec 30, 2018
1 parent f253201 commit b182a21
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/test/ui/issue-54943.rs
@@ -0,0 +1,7 @@
fn foo<T: 'static>() { }

fn main<'a>() {
return;

let x = foo::<&'a u32>();
}
11 changes: 11 additions & 0 deletions src/test/ui/issue-54943.stderr
@@ -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`.

0 comments on commit b182a21

Please sign in to comment.