wf correctly shallow_resolve consts
This commit is contained in:
parent
75b7e52e92
commit
1ec2b9bce8
1 changed files with 7 additions and 9 deletions
|
@ -31,9 +31,9 @@ pub fn obligations<'a, 'tcx>(
|
||||||
if resolved_ty == ty {
|
if resolved_ty == ty {
|
||||||
// No progress, bail out to prevent "livelock".
|
// No progress, bail out to prevent "livelock".
|
||||||
return None;
|
return None;
|
||||||
|
} else {
|
||||||
|
resolved_ty
|
||||||
}
|
}
|
||||||
|
|
||||||
resolved_ty
|
|
||||||
}
|
}
|
||||||
_ => ty,
|
_ => ty,
|
||||||
}
|
}
|
||||||
|
@ -41,16 +41,14 @@ pub fn obligations<'a, 'tcx>(
|
||||||
}
|
}
|
||||||
GenericArgKind::Const(ct) => {
|
GenericArgKind::Const(ct) => {
|
||||||
match ct.kind() {
|
match ct.kind() {
|
||||||
ty::ConstKind::Infer(infer) => {
|
ty::ConstKind::Infer(_) => {
|
||||||
let resolved = infcx.shallow_resolve(infer);
|
let resolved = infcx.shallow_resolve(ct);
|
||||||
if resolved == infer {
|
if resolved == ct {
|
||||||
// No progress.
|
// No progress.
|
||||||
return None;
|
return None;
|
||||||
|
} else {
|
||||||
|
resolved
|
||||||
}
|
}
|
||||||
|
|
||||||
infcx
|
|
||||||
.tcx
|
|
||||||
.mk_const(ty::ConstS { kind: ty::ConstKind::Infer(resolved), ty: ct.ty() })
|
|
||||||
}
|
}
|
||||||
_ => ct,
|
_ => ct,
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue