Normalize generator-local types with unevaluated constants
This commit is contained in:
parent
cfa4ac66c1
commit
d35b23ecd8
2 changed files with 32 additions and 4 deletions
|
@ -726,9 +726,13 @@ fn sanitize_witness<'tcx>(
|
|||
saved_locals: &GeneratorSavedLocals,
|
||||
) {
|
||||
let did = body.source.def_id();
|
||||
let allowed_upvars = tcx.erase_regions(upvars);
|
||||
let param_env = tcx.param_env(did);
|
||||
|
||||
let allowed_upvars = tcx.normalize_erasing_regions(param_env, upvars);
|
||||
let allowed = match witness.kind() {
|
||||
&ty::GeneratorWitness(s) => tcx.erase_late_bound_regions(s),
|
||||
&ty::GeneratorWitness(interior_tys) => {
|
||||
tcx.normalize_erasing_late_bound_regions(param_env, interior_tys)
|
||||
}
|
||||
_ => {
|
||||
tcx.sess.delay_span_bug(
|
||||
body.span,
|
||||
|
@ -738,8 +742,6 @@ fn sanitize_witness<'tcx>(
|
|||
}
|
||||
};
|
||||
|
||||
let param_env = tcx.param_env(did);
|
||||
|
||||
for (local, decl) in body.local_decls.iter_enumerated() {
|
||||
// Ignore locals which are internal or not saved between yields.
|
||||
if !saved_locals.contains(local) || decl.internal {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue