Skip to content

Commit 22833c1

Browse files
author
Lukas Markeffsky
committed
add test for non-defining use of TAIT in foreign function item
1 parent 450cb5e commit 22833c1

File tree

2 files changed

+15
-1
lines changed

2 files changed

+15
-1
lines changed

tests/ui/type-alias-impl-trait/issue-77179.rs

+5
Original file line numberDiff line numberDiff line change
@@ -12,3 +12,8 @@ fn test() -> Pointer<_> {
1212
fn main() {
1313
test();
1414
}
15+
16+
extern "Rust" {
17+
fn bar() -> Pointer<_>;
18+
//~^ ERROR: the placeholder `_` is not allowed within types
19+
}

tests/ui/type-alias-impl-trait/issue-77179.stderr

+10-1
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,15 @@ LL | fn test() -> Pointer<_> {
77
| | not allowed in type signatures
88
| help: replace with the correct return type: `Pointer<i32>`
99

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

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

0 commit comments

Comments
 (0)