Add a regression test for #80779

This commit is contained in:
Yuki Okushi 2021-04-28 18:23:49 +09:00
parent eb753e8ea6
commit de92dfb3b6
2 changed files with 34 additions and 0 deletions

View File

@ -0,0 +1,13 @@
// Regression test for #80779.
pub struct T<'a>(&'a str);
pub fn f<'a>(val: T<'a>) -> _ {
//~^ ERROR: the type placeholder `_` is not allowed within types on item signatures
g(val)
}
pub fn g(_: T<'static>) -> _ {}
//~^ ERROR: the type placeholder `_` is not allowed within types on item signatures
fn main() {}

View File

@ -0,0 +1,21 @@
error[E0121]: the type placeholder `_` is not allowed within types on item signatures
--> $DIR/issue-80779.rs:10:28
|
LL | pub fn g(_: T<'static>) -> _ {}
| ^
| |
| not allowed in type signatures
| help: replace with the correct return type: `()`
error[E0121]: the type placeholder `_` is not allowed within types on item signatures
--> $DIR/issue-80779.rs:5:29
|
LL | pub fn f<'a>(val: T<'a>) -> _ {
| ^
| |
| not allowed in type signatures
| help: replace with the correct return type: `()`
error: aborting due to 2 previous errors
For more information about this error, try `rustc --explain E0121`.