Skip to content

Commit

Permalink
add test for non-defining use of TAIT in foreign function item
Browse files Browse the repository at this point in the history
  • Loading branch information
Lukas Markeffsky committed Jan 16, 2024
1 parent 450cb5e commit 22833c1
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 1 deletion.
5 changes: 5 additions & 0 deletions tests/ui/type-alias-impl-trait/issue-77179.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,8 @@ fn test() -> Pointer<_> {
fn main() {
test();
}

extern "Rust" {
fn bar() -> Pointer<_>;
//~^ ERROR: the placeholder `_` is not allowed within types
}
11 changes: 10 additions & 1 deletion tests/ui/type-alias-impl-trait/issue-77179.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,15 @@ LL | fn test() -> Pointer<_> {
| | not allowed in type signatures
| help: replace with the correct return type: `Pointer<i32>`

error: aborting due to 1 previous error
error[E0121]: the placeholder `_` is not allowed within types on item signatures for functions
--> $DIR/issue-77179.rs:17:25
|
LL | fn bar() -> Pointer<_>;
| ^
| |
| not allowed in type signatures
| help: use type parameters instead: `T`

error: aborting due to 2 previous errors

For more information about this error, try `rustc --explain E0121`.

0 comments on commit 22833c1

Please sign in to comment.