This commit adds a test for checking that types are well-formed when
unreachable.
--- /dev/null
+fn foo<T: 'static>() { }
+
+fn main<'a>() {
+ return;
+
+ let x = foo::<&'a u32>();
+}
--- /dev/null
+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`.