From 9388824b9ec480e0995fa1cec43b852026deb72e Mon Sep 17 00:00:00 2001 From: Camille GILLOT Date: Wed, 22 Jun 2022 21:47:01 +0200 Subject: [PATCH] Contaminate ErrorGuaranteed. --- compiler/rustc_typeck/src/coherence/orphan.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/compiler/rustc_typeck/src/coherence/orphan.rs b/compiler/rustc_typeck/src/coherence/orphan.rs index 8a3d0568f429..f3a043a08a30 100644 --- a/compiler/rustc_typeck/src/coherence/orphan.rs +++ b/compiler/rustc_typeck/src/coherence/orphan.rs @@ -24,8 +24,8 @@ pub(crate) fn orphan_check_impl( impl_def_id: LocalDefId, ) -> Result<(), ErrorGuaranteed> { let trait_ref = tcx.impl_trait_ref(impl_def_id).unwrap(); - if trait_ref.references_error() { - return Ok(()); + if let Some(err) = trait_ref.error_reported() { + return Err(err); } let ret = do_orphan_check_impl(tcx, trait_ref, impl_def_id);