Skip to content

Commit 171d29c

Browse files
authored
Rollup merge of #78739 - hameerabbasi:issue-78654, r=nikomatsakis
Fix ICE on type error in async function Fixes #78654
2 parents 86e6afa + a70e0c2 commit 171d29c

File tree

4 files changed

+55
-0
lines changed

4 files changed

+55
-0
lines changed

compiler/rustc_typeck/src/check/closure.rs

+1
Original file line numberDiff line numberDiff line change
@@ -605,6 +605,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
605605
let ret_ty = self.inh.infcx.shallow_resolve(ret_ty);
606606
let ret_vid = match *ret_ty.kind() {
607607
ty::Infer(ty::TyVar(ret_vid)) => ret_vid,
608+
ty::Error(_) => return None,
608609
_ => span_bug!(
609610
self.tcx.def_span(expr_def_id),
610611
"async fn generator return type not an inference variable"
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
error[E0573]: expected type, found built-in attribute `feature`
2+
--> $DIR/issue-78654.rs:10:15
3+
|
4+
LL | impl<const H: feature> Foo {
5+
| ^^^^^^^ not a type
6+
7+
error[E0207]: the const parameter `H` is not constrained by the impl trait, self type, or predicates
8+
--> $DIR/issue-78654.rs:10:12
9+
|
10+
LL | impl<const H: feature> Foo {
11+
| ^ unconstrained const parameter
12+
|
13+
= note: expressions using a const parameter must map each value to a distinct output value
14+
= note: proving the result of expressions other than the parameter are unique is not supported
15+
16+
error: aborting due to 2 previous errors
17+
18+
Some errors have detailed explanations: E0207, E0573.
19+
For more information about an error, try `rustc --explain E0207`.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
error[E0573]: expected type, found built-in attribute `feature`
2+
--> $DIR/issue-78654.rs:10:15
3+
|
4+
LL | impl<const H: feature> Foo {
5+
| ^^^^^^^ not a type
6+
7+
error[E0207]: the const parameter `H` is not constrained by the impl trait, self type, or predicates
8+
--> $DIR/issue-78654.rs:10:12
9+
|
10+
LL | impl<const H: feature> Foo {
11+
| ^ unconstrained const parameter
12+
|
13+
= note: expressions using a const parameter must map each value to a distinct output value
14+
= note: proving the result of expressions other than the parameter are unique is not supported
15+
16+
error: aborting due to 2 previous errors
17+
18+
Some errors have detailed explanations: E0207, E0573.
19+
For more information about an error, try `rustc --explain E0207`.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
// edition:2018
2+
// revisions: full min
3+
4+
#![cfg_attr(full, feature(const_generics))]
5+
#![cfg_attr(full, allow(incomplete_features))]
6+
#![cfg_attr(min, feature(min_const_generics))]
7+
8+
struct Foo;
9+
10+
impl<const H: feature> Foo {
11+
//~^ ERROR: expected type, found built-in attribute `feature`
12+
//~^^ ERROR: the const parameter `H` is not constrained by the impl trait, self type, or predicates
13+
async fn biz() {}
14+
}
15+
16+
fn main() {}

0 commit comments

Comments
 (0)