We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 98aa362 commit 0727f9aCopy full SHA for 0727f9a
compiler/rustc_hir_analysis/src/coherence/mod.rs
@@ -120,11 +120,11 @@ pub fn provide(providers: &mut Providers) {
120
}
121
122
fn coherent_trait(tcx: TyCtxt<'_>, def_id: DefId) -> Result<(), ErrorGuaranteed> {
123
+ let Some(impls) = tcx.all_local_trait_impls(()).get(&def_id) else { return Ok(()) };
124
// Trigger building the specialization graph for the trait. This will detect and report any
125
// overlap errors.
126
let mut res = tcx.ensure().specialization_graph_of(def_id);
127
- let impls = tcx.hir().trait_impls(def_id);
128
for &impl_def_id in impls {
129
let trait_ref = tcx.impl_trait_ref(impl_def_id).unwrap().instantiate_identity();
130
0 commit comments