1
Fork 0

Add bound_type_of

This commit is contained in:
Jack Huey 2022-05-08 15:12:56 -04:00
parent 319575ae8c
commit c92248ab9f
30 changed files with 90 additions and 83 deletions

View file

@ -14,7 +14,7 @@ use rustc_infer::traits::Normalized;
use rustc_middle::mir;
use rustc_middle::ty::fold::{FallibleTypeFolder, TypeFoldable, TypeFolder};
use rustc_middle::ty::subst::Subst;
use rustc_middle::ty::{self, EarlyBinder, Ty, TyCtxt, TypeVisitor};
use rustc_middle::ty::{self, Ty, TyCtxt, TypeVisitor};
use std::ops::ControlFlow;
@ -217,8 +217,8 @@ impl<'cx, 'tcx> FallibleTypeFolder<'tcx> for QueryNormalizer<'cx, 'tcx> {
self.infcx.report_overflow_error(&obligation, true);
}
let generic_ty = self.tcx().type_of(def_id);
let concrete_ty = EarlyBinder(generic_ty).subst(self.tcx(), substs);
let generic_ty = self.tcx().bound_type_of(def_id);
let concrete_ty = generic_ty.subst(self.tcx(), substs);
self.anon_depth += 1;
if concrete_ty == ty {
bug!(