Add a regression test for #80779
This commit is contained in:
parent
eb753e8ea6
commit
de92dfb3b6
13
src/test/ui/typeck/issue-80779.rs
Normal file
13
src/test/ui/typeck/issue-80779.rs
Normal 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() {}
|
21
src/test/ui/typeck/issue-80779.stderr
Normal file
21
src/test/ui/typeck/issue-80779.stderr
Normal 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`.
|
Loading…
x
Reference in New Issue
Block a user