Skip to content

Commit de92dfb

Browse files
committed
Add a regression test for #80779
1 parent eb753e8 commit de92dfb

File tree

2 files changed

+34
-0
lines changed

2 files changed

+34
-0
lines changed

src/test/ui/typeck/issue-80779.rs

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
// Regression test for #80779.
2+
3+
pub struct T<'a>(&'a str);
4+
5+
pub fn f<'a>(val: T<'a>) -> _ {
6+
//~^ ERROR: the type placeholder `_` is not allowed within types on item signatures
7+
g(val)
8+
}
9+
10+
pub fn g(_: T<'static>) -> _ {}
11+
//~^ ERROR: the type placeholder `_` is not allowed within types on item signatures
12+
13+
fn main() {}

src/test/ui/typeck/issue-80779.stderr

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
error[E0121]: the type placeholder `_` is not allowed within types on item signatures
2+
--> $DIR/issue-80779.rs:10:28
3+
|
4+
LL | pub fn g(_: T<'static>) -> _ {}
5+
| ^
6+
| |
7+
| not allowed in type signatures
8+
| help: replace with the correct return type: `()`
9+
10+
error[E0121]: the type placeholder `_` is not allowed within types on item signatures
11+
--> $DIR/issue-80779.rs:5:29
12+
|
13+
LL | pub fn f<'a>(val: T<'a>) -> _ {
14+
| ^
15+
| |
16+
| not allowed in type signatures
17+
| help: replace with the correct return type: `()`
18+
19+
error: aborting due to 2 previous errors
20+
21+
For more information about this error, try `rustc --explain E0121`.

0 commit comments

Comments
 (0)