Skip to content

Commit 1ec2b9b

Browse files
committed
wf correctly shallow_resolve consts
1 parent 75b7e52 commit 1ec2b9b

File tree

1 file changed

+7
-9
lines changed
  • compiler/rustc_trait_selection/src/traits

1 file changed

+7
-9
lines changed

Diff for: compiler/rustc_trait_selection/src/traits/wf.rs

+7-9
Original file line numberDiff line numberDiff line change
@@ -31,26 +31,24 @@ pub fn obligations<'a, 'tcx>(
3131
if resolved_ty == ty {
3232
// No progress, bail out to prevent "livelock".
3333
return None;
34+
} else {
35+
resolved_ty
3436
}
35-
36-
resolved_ty
3737
}
3838
_ => ty,
3939
}
4040
.into()
4141
}
4242
GenericArgKind::Const(ct) => {
4343
match ct.kind() {
44-
ty::ConstKind::Infer(infer) => {
45-
let resolved = infcx.shallow_resolve(infer);
46-
if resolved == infer {
44+
ty::ConstKind::Infer(_) => {
45+
let resolved = infcx.shallow_resolve(ct);
46+
if resolved == ct {
4747
// No progress.
4848
return None;
49+
} else {
50+
resolved
4951
}
50-
51-
infcx
52-
.tcx
53-
.mk_const(ty::ConstS { kind: ty::ConstKind::Infer(resolved), ty: ct.ty() })
5452
}
5553
_ => ct,
5654
}

0 commit comments

Comments
 (0)