1
Fork 0

Make ProjectionTy::trait_ref truncate substs again

Also make sure that type arguments of associated types are printed in
some error messages.
This commit is contained in:
Matthew Jasper 2021-02-12 22:44:43 +00:00
parent 79f6f11816
commit dfee89f755
12 changed files with 216 additions and 49 deletions

View file

@ -1589,8 +1589,7 @@ impl<'a, 'tcx> InferCtxtPrivExt<'tcx> for InferCtxt<'a, 'tcx> {
self.emit_inference_failure_err(body_id, span, a.into(), vec![], ErrorCode::E0282)
}
ty::PredicateKind::Projection(data) => {
let trait_ref = bound_predicate.rebind(data).to_poly_trait_ref(self.tcx);
let self_ty = trait_ref.skip_binder().self_ty();
let self_ty = data.projection_ty.self_ty();
let ty = data.ty;
if predicate.references_error() {
return;