Skip to content

Commit b182a21

Browse files
committed
Add test for unreachable well-formedness.
This commit adds a test for checking that types are well-formed when unreachable.
1 parent f253201 commit b182a21

File tree

2 files changed

+18
-0
lines changed

2 files changed

+18
-0
lines changed

src/test/ui/issue-54943.rs

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
fn foo<T: 'static>() { }
2+
3+
fn main<'a>() {
4+
return;
5+
6+
let x = foo::<&'a u32>();
7+
}

src/test/ui/issue-54943.stderr

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

0 commit comments

Comments
 (0)