1
Fork 0

add tcx to fn walk

This commit is contained in:
lcnr 2021-07-17 16:43:23 +02:00
parent bfaf13af4e
commit cc47998e28
29 changed files with 73 additions and 67 deletions

View file

@ -278,7 +278,7 @@ fn predicate_references_self(
(predicate, sp): (ty::Predicate<'tcx>, Span),
) -> Option<Span> {
let self_ty = tcx.types.self_param;
let has_self_ty = |arg: &GenericArg<'_>| arg.walk().any(|arg| arg == self_ty.into());
let has_self_ty = |arg: &GenericArg<'tcx>| arg.walk(tcx).any(|arg| arg == self_ty.into());
match predicate.kind().skip_binder() {
ty::PredicateKind::Trait(ref data) => {
// In the case of a trait predicate, we can skip the "self" type.