Skip to content

Commit a861737

Browse files
committed
Fix nits
1 parent 62f9962 commit a861737

File tree

2 files changed

+4
-7
lines changed

2 files changed

+4
-7
lines changed

compiler/rustc_infer/src/infer/error_reporting/nice_region_error/placeholder_error.rs

+2-4
Original file line numberDiff line numberDiff line change
@@ -333,17 +333,15 @@ impl<'tcx> NiceRegionError<'_, 'tcx> {
333333
leading_ellipsis,
334334
);
335335

336-
let diag = TraitPlaceholderMismatch {
336+
self.tcx().sess.create_err(TraitPlaceholderMismatch {
337337
span,
338338
satisfy_span,
339339
where_span,
340340
dup_span,
341341
def_id,
342342
trait_def_id: self.tcx().def_path_str(trait_def_id),
343343
actual_impl_expl_notes,
344-
};
345-
346-
self.tcx().sess.create_err(diag)
344+
})
347345
}
348346

349347
/// Add notes with details about the expected and actual trait refs, with attention to cases

compiler/rustc_infer/src/infer/error_reporting/nice_region_error/static_impl_trait.rs

+2-3
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ impl<'a, 'tcx> NiceRegionError<'a, 'tcx> {
6363
AssocItemContainer::ImplContainer => (false, String::new()),
6464
};
6565

66-
let diag = ButCallingIntroduces {
66+
let mut err = self.tcx().sess.create_err(ButCallingIntroduces {
6767
param_ty_span: param.param_ty_span,
6868
cause_span: cause.span,
6969
has_param_name: simple_ident.is_some(),
@@ -73,8 +73,7 @@ impl<'a, 'tcx> NiceRegionError<'a, 'tcx> {
7373
assoc_item: ctxt.assoc_item.name,
7474
has_impl_path,
7575
impl_path,
76-
};
77-
let mut err = self.tcx().sess.create_err(diag);
76+
});
7877
if self.find_impl_on_dyn_trait(&mut err, param.param_ty, &ctxt) {
7978
let reported = err.emit();
8079
return Some(reported);

0 commit comments

Comments
 (0)