X-Git-Url: https://git.lizzy.rs/?a=blobdiff_plain;f=compiler%2Frustc_passes%2Fsrc%2Fdead.rs;h=94171b4b0c8f1b5ffa6021d2bf3a68c035aceb5c;hb=6874f4e3fc2a16be7c78e702d068bbc1daa90e16;hp=edb0e4367f27354114415fa2dccac4ba576a1af8;hpb=d28ef9dbf1e9bedd0a30ad96ead65d95aaa09ebb;p=rust.git diff --git a/compiler/rustc_passes/src/dead.rs b/compiler/rustc_passes/src/dead.rs index edb0e4367f2..94171b4b0c8 100644 --- a/compiler/rustc_passes/src/dead.rs +++ b/compiler/rustc_passes/src/dead.rs @@ -266,7 +266,7 @@ fn should_ignore_item(&mut self, def_id: DefId) -> bool { if let Some(trait_of) = self.tcx.trait_id_of_impl(impl_of) && self.tcx.has_attr(trait_of, sym::rustc_trivial_field_reads) { - let trait_ref = self.tcx.impl_trait_ref(impl_of).unwrap(); + let trait_ref = self.tcx.impl_trait_ref(impl_of).unwrap().subst_identity(); if let ty::Adt(adt_def, _) = trait_ref.self_ty().kind() && let Some(adt_def_id) = adt_def.did().as_local() {