diff options
| author | Michael Goulet <michael@errs.io> | 2022-08-13 14:10:13 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-08-13 14:10:13 -0700 |
| commit | aafaec38bbbab2395e057cee4e188c6b9a68373a (patch) | |
| tree | 7e240e3b01e1cb51fa24c0e262d72908d50d8871 /compiler | |
| parent | 29f905bfafed0c6821f4973287593803fa033b80 (diff) | |
| parent | 1ec2b9bce8caf6d132b0fc42affe51b8cac8f458 (diff) | |
| download | rust-aafaec38bbbab2395e057cee4e188c6b9a68373a.tar.gz rust-aafaec38bbbab2395e057cee4e188c6b9a68373a.zip | |
Rollup merge of #100490 - lcnr:wf-consts, r=jackh726
wf: correctly `shallow_resolve` consts `shallow_resolve` on `InferConst` is always a noop. this is mostly irrelevant as inference vars should already be resolved at most - if not all - call sites. Haven't actually looked too deeply into whether this was a problem.
Diffstat (limited to 'compiler')
| -rw-r--r-- | compiler/rustc_trait_selection/src/traits/wf.rs | 16 |
1 files changed, 7 insertions, 9 deletions
diff --git a/compiler/rustc_trait_selection/src/traits/wf.rs b/compiler/rustc_trait_selection/src/traits/wf.rs index 414857f0acc..7a5e67ff74b 100644 --- a/compiler/rustc_trait_selection/src/traits/wf.rs +++ b/compiler/rustc_trait_selection/src/traits/wf.rs @@ -31,9 +31,9 @@ pub fn obligations<'a, 'tcx>( if resolved_ty == ty { // No progress, bail out to prevent "livelock". return None; + } else { + resolved_ty } - - resolved_ty } _ => ty, } @@ -41,16 +41,14 @@ pub fn obligations<'a, 'tcx>( } GenericArgKind::Const(ct) => { match ct.kind() { - ty::ConstKind::Infer(infer) => { - let resolved = infcx.shallow_resolve(infer); - if resolved == infer { + ty::ConstKind::Infer(_) => { + let resolved = infcx.shallow_resolve(ct); + if resolved == ct { // No progress. return None; + } else { + resolved } - - infcx - .tcx - .mk_const(ty::ConstS { kind: ty::ConstKind::Infer(resolved), ty: ct.ty() }) } _ => ct, } |
