This commit is contained in:
Nikita Tomashevich 2022-11-03 21:56:15 +03:00
parent 62f9962eaf
commit a86173766c
No known key found for this signature in database
GPG Key ID: B29791D4D878E345
2 changed files with 4 additions and 7 deletions

View File

@ -333,7 +333,7 @@ impl<'tcx> NiceRegionError<'_, 'tcx> {
leading_ellipsis,
);
let diag = TraitPlaceholderMismatch {
self.tcx().sess.create_err(TraitPlaceholderMismatch {
span,
satisfy_span,
where_span,
@ -341,9 +341,7 @@ impl<'tcx> NiceRegionError<'_, 'tcx> {
def_id,
trait_def_id: self.tcx().def_path_str(trait_def_id),
actual_impl_expl_notes,
};
self.tcx().sess.create_err(diag)
})
}
/// Add notes with details about the expected and actual trait refs, with attention to cases

View File

@ -63,7 +63,7 @@ impl<'a, 'tcx> NiceRegionError<'a, 'tcx> {
AssocItemContainer::ImplContainer => (false, String::new()),
};
let diag = ButCallingIntroduces {
let mut err = self.tcx().sess.create_err(ButCallingIntroduces {
param_ty_span: param.param_ty_span,
cause_span: cause.span,
has_param_name: simple_ident.is_some(),
@ -73,8 +73,7 @@ impl<'a, 'tcx> NiceRegionError<'a, 'tcx> {
assoc_item: ctxt.assoc_item.name,
has_impl_path,
impl_path,
};
let mut err = self.tcx().sess.create_err(diag);
});
if self.find_impl_on_dyn_trait(&mut err, param.param_ty, &ctxt) {
let reported = err.emit();
return Some(reported);