1
Fork 0

Rollup merge of #94315 - lcnr:auto-trait-lint-update, r=oli-obk

update auto trait lint for `PhantomData`

cc https://github.com/rust-lang/rust/issues/93367#issuecomment-1047898410
This commit is contained in:
Dylan DPC 2022-02-24 21:42:17 +01:00 committed by GitHub
commit 9e7131a0d3
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 33 additions and 7 deletions

View file

@ -439,6 +439,7 @@ fn fast_reject_auto_impl<'tcx>(tcx: TyCtxt<'tcx>, trait_def_id: DefId, self_ty:
}
match t.kind() {
ty::Adt(def, substs) if def.is_phantom_data() => substs.super_visit_with(self),
ty::Adt(def, substs) => {
// @lcnr: This is the only place where cycles can happen. We avoid this
// by only visiting each `DefId` once.