Skip to content

Commit 0ed76b4

Browse files
authored
Rollup merge of #108604 - JohnTitor:issue-107280, r=compiler-errors
Add regression test for #107280 Closes #107280 r? compiler-errors
2 parents 9d132f7 + 9642346 commit 0ed76b4

File tree

2 files changed

+97
-0
lines changed

2 files changed

+97
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
// edition:2021
2+
3+
async fn foo() {
4+
inner::<false>().await
5+
//~^ ERROR: function takes 2 generic arguments but 1 generic argument was supplied
6+
//~| ERROR: type inside `async fn` body must be known in this context
7+
//~| ERROR: type inside `async fn` body must be known in this context
8+
//~| ERROR: type inside `async fn` body must be known in this context
9+
//~| ERROR: type inside `async fn` body must be known in this context
10+
//~| ERROR: type inside `async fn` body must be known in this context
11+
}
12+
13+
async fn inner<T, const PING: bool>() {}
14+
15+
fn main() {}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
error[E0107]: function takes 2 generic arguments but 1 generic argument was supplied
2+
--> $DIR/issue-107280.rs:4:5
3+
|
4+
LL | inner::<false>().await
5+
| ^^^^^ ----- supplied 1 generic argument
6+
| |
7+
| expected 2 generic arguments
8+
|
9+
note: function defined here, with 2 generic parameters: `T`, `PING`
10+
--> $DIR/issue-107280.rs:13:10
11+
|
12+
LL | async fn inner<T, const PING: bool>() {}
13+
| ^^^^^ - ----------------
14+
help: add missing generic argument
15+
|
16+
LL | inner::<false, PING>().await
17+
| ++++++
18+
19+
error[E0698]: type inside `async fn` body must be known in this context
20+
--> $DIR/issue-107280.rs:4:5
21+
|
22+
LL | inner::<false>().await
23+
| ^^^^^^^^^^^^^^ cannot infer the value of const parameter `PING` declared on the function `inner`
24+
|
25+
note: the type is part of the `async fn` body because of this `await`
26+
--> $DIR/issue-107280.rs:4:21
27+
|
28+
LL | inner::<false>().await
29+
| ^^^^^^
30+
31+
error[E0698]: type inside `async fn` body must be known in this context
32+
--> $DIR/issue-107280.rs:4:5
33+
|
34+
LL | inner::<false>().await
35+
| ^^^^^^^^^^^^^^ cannot infer the value of const parameter `PING` declared on the function `inner`
36+
|
37+
note: the type is part of the `async fn` body because of this `await`
38+
--> $DIR/issue-107280.rs:4:21
39+
|
40+
LL | inner::<false>().await
41+
| ^^^^^^
42+
43+
error[E0698]: type inside `async fn` body must be known in this context
44+
--> $DIR/issue-107280.rs:4:5
45+
|
46+
LL | inner::<false>().await
47+
| ^^^^^^^^^^^^^^ cannot infer the value of const parameter `PING` declared on the function `inner`
48+
|
49+
note: the type is part of the `async fn` body because of this `await`
50+
--> $DIR/issue-107280.rs:4:21
51+
|
52+
LL | inner::<false>().await
53+
| ^^^^^^
54+
55+
error[E0698]: type inside `async fn` body must be known in this context
56+
--> $DIR/issue-107280.rs:4:5
57+
|
58+
LL | inner::<false>().await
59+
| ^^^^^^^^^^^^^^ cannot infer the value of const parameter `PING` declared on the function `inner`
60+
|
61+
note: the type is part of the `async fn` body because of this `await`
62+
--> $DIR/issue-107280.rs:4:21
63+
|
64+
LL | inner::<false>().await
65+
| ^^^^^^
66+
67+
error[E0698]: type inside `async fn` body must be known in this context
68+
--> $DIR/issue-107280.rs:4:5
69+
|
70+
LL | inner::<false>().await
71+
| ^^^^^^^^^^^^^^ cannot infer the value of const parameter `PING` declared on the function `inner`
72+
|
73+
note: the type is part of the `async fn` body because of this `await`
74+
--> $DIR/issue-107280.rs:4:21
75+
|
76+
LL | inner::<false>().await
77+
| ^^^^^^
78+
79+
error: aborting due to 6 previous errors
80+
81+
Some errors have detailed explanations: E0107, E0698.
82+
For more information about an error, try `rustc --explain E0107`.

0 commit comments

Comments
 (0)