1
Fork 0

Rollup merge of #103915 - chenyukang:yukang/fix-103874, r=lcnr

Improve use of ErrorGuaranteed and code cleanup

Part of #103874
This commit is contained in:
Matthias Krüger 2022-11-04 06:40:32 +01:00 committed by GitHub
commit 61c6cdb5f4
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
15 changed files with 30 additions and 51 deletions

View file

@ -23,9 +23,7 @@ pub(crate) fn orphan_check_impl(
impl_def_id: LocalDefId,
) -> Result<(), ErrorGuaranteed> {
let trait_ref = tcx.impl_trait_ref(impl_def_id).unwrap();
if let Some(err) = trait_ref.error_reported() {
return Err(err);
}
trait_ref.error_reported()?;
let ret = do_orphan_check_impl(tcx, trait_ref, impl_def_id);
if tcx.trait_is_auto(trait_ref.def_id) {