From e489a94deef3d41513fe4254804d730f0fd6cbc0 Mon Sep 17 00:00:00 2001 From: mark Date: Sun, 23 Jan 2022 12:34:26 -0600 Subject: rename ErrorReported -> ErrorGuaranteed --- .../src/diagnostics/bound_region_errors.rs | 20 ++++++++++---------- .../src/diagnostics/conflict_errors.rs | 18 +++++++++--------- .../rustc_borrowck/src/diagnostics/move_errors.rs | 6 +++--- .../rustc_borrowck/src/diagnostics/region_errors.rs | 8 ++++---- 4 files changed, 26 insertions(+), 26 deletions(-) (limited to 'compiler/rustc_borrowck/src/diagnostics') diff --git a/compiler/rustc_borrowck/src/diagnostics/bound_region_errors.rs b/compiler/rustc_borrowck/src/diagnostics/bound_region_errors.rs index 3ef002bf740..7507ea76ed0 100644 --- a/compiler/rustc_borrowck/src/diagnostics/bound_region_errors.rs +++ b/compiler/rustc_borrowck/src/diagnostics/bound_region_errors.rs @@ -1,4 +1,4 @@ -use rustc_errors::{DiagnosticBuilder, ErrorReported}; +use rustc_errors::{DiagnosticBuilder, ErrorGuaranteed}; use rustc_infer::infer::canonical::Canonical; use rustc_infer::infer::error_reporting::nice_region_error::NiceRegionError; use rustc_infer::infer::region_constraints::Constraint; @@ -124,7 +124,7 @@ trait TypeOpInfo<'tcx> { &self, tcx: TyCtxt<'tcx>, span: Span, - ) -> DiagnosticBuilder<'tcx, ErrorReported>; + ) -> DiagnosticBuilder<'tcx, ErrorGuaranteed>; fn base_universe(&self) -> ty::UniverseIndex; @@ -134,7 +134,7 @@ trait TypeOpInfo<'tcx> { cause: ObligationCause<'tcx>, placeholder_region: ty::Region<'tcx>, error_region: Option>, - ) -> Option>; + ) -> Option>; fn report_error( &self, @@ -196,7 +196,7 @@ impl<'tcx> TypeOpInfo<'tcx> for PredicateQuery<'tcx> { &self, tcx: TyCtxt<'tcx>, span: Span, - ) -> DiagnosticBuilder<'tcx, ErrorReported> { + ) -> DiagnosticBuilder<'tcx, ErrorGuaranteed> { let mut err = tcx.sess.struct_span_err(span, "higher-ranked lifetime error"); err.note(&format!("could not prove {}", self.canonical_query.value.value.predicate)); err @@ -212,7 +212,7 @@ impl<'tcx> TypeOpInfo<'tcx> for PredicateQuery<'tcx> { cause: ObligationCause<'tcx>, placeholder_region: ty::Region<'tcx>, error_region: Option>, - ) -> Option> { + ) -> Option> { tcx.infer_ctxt().enter_with_canonical( cause.span, &self.canonical_query, @@ -243,7 +243,7 @@ where &self, tcx: TyCtxt<'tcx>, span: Span, - ) -> DiagnosticBuilder<'tcx, ErrorReported> { + ) -> DiagnosticBuilder<'tcx, ErrorGuaranteed> { let mut err = tcx.sess.struct_span_err(span, "higher-ranked lifetime error"); err.note(&format!("could not normalize `{}`", self.canonical_query.value.value.value)); err @@ -259,7 +259,7 @@ where cause: ObligationCause<'tcx>, placeholder_region: ty::Region<'tcx>, error_region: Option>, - ) -> Option> { + ) -> Option> { tcx.infer_ctxt().enter_with_canonical( cause.span, &self.canonical_query, @@ -304,7 +304,7 @@ impl<'tcx> TypeOpInfo<'tcx> for AscribeUserTypeQuery<'tcx> { &self, tcx: TyCtxt<'tcx>, span: Span, - ) -> DiagnosticBuilder<'tcx, ErrorReported> { + ) -> DiagnosticBuilder<'tcx, ErrorGuaranteed> { // FIXME: This error message isn't great, but it doesn't show up in the existing UI tests, // and is only the fallback when the nice error fails. Consider improving this some more. tcx.sess.struct_span_err(span, "higher-ranked lifetime error") @@ -320,7 +320,7 @@ impl<'tcx> TypeOpInfo<'tcx> for AscribeUserTypeQuery<'tcx> { cause: ObligationCause<'tcx>, placeholder_region: ty::Region<'tcx>, error_region: Option>, - ) -> Option> { + ) -> Option> { tcx.infer_ctxt().enter_with_canonical( cause.span, &self.canonical_query, @@ -345,7 +345,7 @@ fn try_extract_error_from_fulfill_cx<'tcx>( infcx: &InferCtxt<'_, 'tcx>, placeholder_region: ty::Region<'tcx>, error_region: Option>, -) -> Option> { +) -> Option> { let tcx = infcx.tcx; // We generally shouldn't have errors here because the query was diff --git a/compiler/rustc_borrowck/src/diagnostics/conflict_errors.rs b/compiler/rustc_borrowck/src/diagnostics/conflict_errors.rs index eb906d5fde7..4502d15f36f 100644 --- a/compiler/rustc_borrowck/src/diagnostics/conflict_errors.rs +++ b/compiler/rustc_borrowck/src/diagnostics/conflict_errors.rs @@ -1,7 +1,7 @@ use either::Either; use rustc_const_eval::util::{CallDesugaringKind, CallKind}; use rustc_data_structures::fx::FxHashSet; -use rustc_errors::{Applicability, Diagnostic, DiagnosticBuilder, ErrorReported}; +use rustc_errors::{Applicability, Diagnostic, DiagnosticBuilder, ErrorGuaranteed}; use rustc_hir as hir; use rustc_hir::def_id::DefId; use rustc_hir::{AsyncGeneratorKind, GeneratorKind}; @@ -507,7 +507,7 @@ impl<'cx, 'tcx> MirBorrowckCtxt<'cx, 'tcx> { location: Location, (place, _span): (Place<'tcx>, Span), borrow: &BorrowData<'tcx>, - ) -> DiagnosticBuilder<'cx, ErrorReported> { + ) -> DiagnosticBuilder<'cx, ErrorGuaranteed> { let borrow_spans = self.retrieve_borrow_spans(borrow); let borrow_span = borrow_spans.args_or_use(); @@ -554,7 +554,7 @@ impl<'cx, 'tcx> MirBorrowckCtxt<'cx, 'tcx> { (place, span): (Place<'tcx>, Span), gen_borrow_kind: BorrowKind, issued_borrow: &BorrowData<'tcx>, - ) -> DiagnosticBuilder<'cx, ErrorReported> { + ) -> DiagnosticBuilder<'cx, ErrorGuaranteed> { let issued_spans = self.retrieve_borrow_spans(issued_borrow); let issued_span = issued_spans.args_or_use(); @@ -1120,7 +1120,7 @@ impl<'cx, 'tcx> MirBorrowckCtxt<'cx, 'tcx> { drop_span: Span, borrow_spans: UseSpans<'tcx>, explanation: BorrowExplanation, - ) -> DiagnosticBuilder<'cx, ErrorReported> { + ) -> DiagnosticBuilder<'cx, ErrorGuaranteed> { debug!( "report_local_value_does_not_live_long_enough(\ {:?}, {:?}, {:?}, {:?}, {:?}\ @@ -1298,7 +1298,7 @@ impl<'cx, 'tcx> MirBorrowckCtxt<'cx, 'tcx> { &mut self, drop_span: Span, borrow_span: Span, - ) -> DiagnosticBuilder<'cx, ErrorReported> { + ) -> DiagnosticBuilder<'cx, ErrorGuaranteed> { debug!( "report_thread_local_value_does_not_live_long_enough(\ {:?}, {:?}\ @@ -1325,7 +1325,7 @@ impl<'cx, 'tcx> MirBorrowckCtxt<'cx, 'tcx> { borrow_spans: UseSpans<'tcx>, proper_span: Span, explanation: BorrowExplanation, - ) -> DiagnosticBuilder<'cx, ErrorReported> { + ) -> DiagnosticBuilder<'cx, ErrorGuaranteed> { debug!( "report_temporary_value_does_not_live_long_enough(\ {:?}, {:?}, {:?}, {:?}\ @@ -1384,7 +1384,7 @@ impl<'cx, 'tcx> MirBorrowckCtxt<'cx, 'tcx> { return_span: Span, category: ConstraintCategory, opt_place_desc: Option<&String>, - ) -> Option> { + ) -> Option> { let return_kind = match category { ConstraintCategory::Return(_) => "return", ConstraintCategory::Yield => "yield", @@ -1483,7 +1483,7 @@ impl<'cx, 'tcx> MirBorrowckCtxt<'cx, 'tcx> { category: ConstraintCategory, constraint_span: Span, captured_var: &str, - ) -> DiagnosticBuilder<'cx, ErrorReported> { + ) -> DiagnosticBuilder<'cx, ErrorGuaranteed> { let tcx = self.infcx.tcx; let args_span = use_span.args_or_use(); @@ -1560,7 +1560,7 @@ impl<'cx, 'tcx> MirBorrowckCtxt<'cx, 'tcx> { upvar_span: Span, upvar_name: &str, escape_span: Span, - ) -> DiagnosticBuilder<'cx, ErrorReported> { + ) -> DiagnosticBuilder<'cx, ErrorGuaranteed> { let tcx = self.infcx.tcx; let (_, escapes_from) = tcx.article_and_description(self.mir_def_id().to_def_id()); diff --git a/compiler/rustc_borrowck/src/diagnostics/move_errors.rs b/compiler/rustc_borrowck/src/diagnostics/move_errors.rs index 66f4c28a36d..19091569b4d 100644 --- a/compiler/rustc_borrowck/src/diagnostics/move_errors.rs +++ b/compiler/rustc_borrowck/src/diagnostics/move_errors.rs @@ -1,5 +1,5 @@ use rustc_const_eval::util::CallDesugaringKind; -use rustc_errors::{Applicability, Diagnostic, DiagnosticBuilder, ErrorReported}; +use rustc_errors::{Applicability, Diagnostic, DiagnosticBuilder, ErrorGuaranteed}; use rustc_infer::infer::TyCtxtInferExt; use rustc_middle::mir::*; use rustc_middle::ty; @@ -271,7 +271,7 @@ impl<'a, 'tcx> MirBorrowckCtxt<'a, 'tcx> { &mut self, place: Place<'tcx>, span: Span, - ) -> DiagnosticBuilder<'a, ErrorReported> { + ) -> DiagnosticBuilder<'a, ErrorGuaranteed> { let description = if place.projection.len() == 1 { format!("static item {}", self.describe_any_place(place.as_ref())) } else { @@ -293,7 +293,7 @@ impl<'a, 'tcx> MirBorrowckCtxt<'a, 'tcx> { deref_target_place: Place<'tcx>, span: Span, use_spans: Option>, - ) -> DiagnosticBuilder<'a, ErrorReported> { + ) -> DiagnosticBuilder<'a, ErrorGuaranteed> { // Inspect the type of the content behind the // borrow to provide feedback about why this // was a move rather than a copy. diff --git a/compiler/rustc_borrowck/src/diagnostics/region_errors.rs b/compiler/rustc_borrowck/src/diagnostics/region_errors.rs index 369aef6798b..38b16fedd3a 100644 --- a/compiler/rustc_borrowck/src/diagnostics/region_errors.rs +++ b/compiler/rustc_borrowck/src/diagnostics/region_errors.rs @@ -1,6 +1,6 @@ //! Error reporting machinery for lifetime errors. -use rustc_errors::{Applicability, Diagnostic, DiagnosticBuilder, ErrorReported}; +use rustc_errors::{Applicability, Diagnostic, DiagnosticBuilder, ErrorGuaranteed}; use rustc_infer::infer::{ error_reporting::nice_region_error::NiceRegionError, error_reporting::unexpected_hidden_region_diagnostic, NllRegionVariableOrigin, @@ -389,7 +389,7 @@ impl<'a, 'tcx> MirBorrowckCtxt<'a, 'tcx> { &self, errci: &ErrorConstraintInfo, kind: ReturnConstraint, - ) -> DiagnosticBuilder<'tcx, ErrorReported> { + ) -> DiagnosticBuilder<'tcx, ErrorGuaranteed> { let ErrorConstraintInfo { outlived_fr, span, .. } = errci; let mut diag = self @@ -469,7 +469,7 @@ impl<'a, 'tcx> MirBorrowckCtxt<'a, 'tcx> { fn report_escaping_data_error( &self, errci: &ErrorConstraintInfo, - ) -> DiagnosticBuilder<'tcx, ErrorReported> { + ) -> DiagnosticBuilder<'tcx, ErrorGuaranteed> { let ErrorConstraintInfo { span, category, .. } = errci; let fr_name_and_span = self.regioncx.get_var_name_and_span_for_region( @@ -573,7 +573,7 @@ impl<'a, 'tcx> MirBorrowckCtxt<'a, 'tcx> { fn report_general_error( &self, errci: &ErrorConstraintInfo, - ) -> DiagnosticBuilder<'tcx, ErrorReported> { + ) -> DiagnosticBuilder<'tcx, ErrorGuaranteed> { let ErrorConstraintInfo { fr, fr_is_local, -- cgit 1.4.1-3-g733a5