Skip to content

Commit 36e9cbc

Browse files
authored
Rollup merge of #97829 - JohnTitor:issue-95307, r=compiler-errors
Add regresion test for #95307 Closes #95307 r? `@compiler-errors`
2 parents 5435ed6 + 786c8b4 commit 36e9cbc

File tree

2 files changed

+43
-0
lines changed

2 files changed

+43
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
// edition:2018
2+
3+
// Regression test for #95307.
4+
// The ICE occurred on all the editions, specifying edition:2018 to reduce diagnostics.
5+
6+
pub trait C {
7+
async fn new() -> [u8; _];
8+
//~^ ERROR: functions in traits cannot be declared `async`
9+
//~| ERROR: using `_` for array lengths is unstable
10+
//~| ERROR: in expressions, `_` can only be used on the left-hand side of an assignment
11+
}
12+
13+
fn main() {}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
error[E0706]: functions in traits cannot be declared `async`
2+
--> $DIR/issue-95307.rs:7:5
3+
|
4+
LL | async fn new() -> [u8; _];
5+
| -----^^^^^^^^^^^^^^^^^^^^^
6+
| |
7+
| `async` because of this
8+
|
9+
= note: `async` trait functions are not currently supported
10+
= note: consider using the `async-trait` crate: https://crates.io/crates/async-trait
11+
12+
error[E0658]: using `_` for array lengths is unstable
13+
--> $DIR/issue-95307.rs:7:28
14+
|
15+
LL | async fn new() -> [u8; _];
16+
| ^
17+
|
18+
= note: see issue #85077 <https://github.com/rust-lang/rust/issues/85077> for more information
19+
= help: add `#![feature(generic_arg_infer)]` to the crate attributes to enable
20+
21+
error: in expressions, `_` can only be used on the left-hand side of an assignment
22+
--> $DIR/issue-95307.rs:7:28
23+
|
24+
LL | async fn new() -> [u8; _];
25+
| ^ `_` not allowed here
26+
27+
error: aborting due to 3 previous errors
28+
29+
Some errors have detailed explanations: E0658, E0706.
30+
For more information about an error, try `rustc --explain E0658`.

0 commit comments

Comments
 (0)