1
Fork 0

change error_reported to use Result instead of an option

This commit is contained in:
yukang 2022-11-03 04:57:44 +08:00
parent 7df9d818ab
commit ab22f5521b
7 changed files with 15 additions and 22 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) {