1
Fork 0

skip if val has ecaping bound vars

This commit is contained in:
ouz-a 2022-12-14 13:59:29 +03:00
parent 37d7de3379
commit 75cf31faa8
2 changed files with 28 additions and 12 deletions

View file

@ -451,6 +451,7 @@ impl<'tcx> WfPredicates<'tcx> {
GenericArgKind::Const(ct) => {
match ct.kind() {
ty::ConstKind::Unevaluated(uv) => {
if !ct.has_escaping_bound_vars() {
let obligations = self.nominal_obligations(uv.def.did, uv.substs);
self.out.extend(obligations);
@ -465,6 +466,7 @@ impl<'tcx> WfPredicates<'tcx> {
predicate,
));
}
}
ty::ConstKind::Infer(_) => {
let cause = self.cause(traits::WellFormed(None));

View file

@ -0,0 +1,14 @@
// check-pass
// edition:2021
#![feature(generic_const_exprs)]
#![allow(incomplete_features)]
#[allow(unused)]
async fn foo<'a>() {
let _data = &mut [0u8; { 1 + 4 }];
bar().await
}
async fn bar() {}
fn main() {}