diff options
Diffstat (limited to 'compiler/rustc_hir_analysis/src/check/dropck.rs')
| -rw-r--r-- | compiler/rustc_hir_analysis/src/check/dropck.rs | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/compiler/rustc_hir_analysis/src/check/dropck.rs b/compiler/rustc_hir_analysis/src/check/dropck.rs index ff78d040aca..3275a81c3dd 100644 --- a/compiler/rustc_hir_analysis/src/check/dropck.rs +++ b/compiler/rustc_hir_analysis/src/check/dropck.rs @@ -2,7 +2,7 @@ // // We don't do any drop checking during hir typeck. use rustc_data_structures::fx::FxHashSet; -use rustc_errors::{struct_span_err, ErrorGuaranteed}; +use rustc_errors::{struct_span_code_err, ErrorGuaranteed}; use rustc_infer::infer::outlives::env::OutlivesEnvironment; use rustc_infer::infer::{RegionResolutionError, TyCtxtInferExt}; use rustc_middle::ty::util::CheckRegions; @@ -88,8 +88,12 @@ fn ensure_drop_params_and_item_params_correspond<'tcx>( let drop_impl_span = tcx.def_span(drop_impl_did); let item_span = tcx.def_span(self_type_did); let self_descr = tcx.def_descr(self_type_did); - let mut err = - struct_span_err!(tcx.dcx(), drop_impl_span, E0366, "`Drop` impls cannot be specialized"); + let mut err = struct_span_code_err!( + tcx.dcx(), + drop_impl_span, + E0366, + "`Drop` impls cannot be specialized" + ); match arg { ty::util::NotUniqueParam::DuplicateParam(arg) => { err.note(format!("`{arg}` is mentioned multiple times")) @@ -154,14 +158,14 @@ fn ensure_drop_predicates_are_implied_by_item_defn<'tcx>( let item_span = tcx.def_span(adt_def_id); let self_descr = tcx.def_descr(adt_def_id.to_def_id()); guar = Some( - struct_span_err!( + struct_span_code_err!( tcx.dcx(), error.root_obligation.cause.span, E0367, "`Drop` impl requires `{root_predicate}` \ but the {self_descr} it is implemented for does not", ) - .span_note_mv(item_span, "the implementor must specify the same requirement") + .with_span_note(item_span, "the implementor must specify the same requirement") .emit(), ); } @@ -186,14 +190,14 @@ fn ensure_drop_predicates_are_implied_by_item_defn<'tcx>( } }; guar = Some( - struct_span_err!( + struct_span_code_err!( tcx.dcx(), error.origin().span(), E0367, "`Drop` impl requires `{outlives}` \ but the {self_descr} it is implemented for does not", ) - .span_note_mv(item_span, "the implementor must specify the same requirement") + .with_span_note(item_span, "the implementor must specify the same requirement") .emit(), ); } |
