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/transform/check_consts/check.rs | 8 ++-- .../src/transform/check_consts/ops.rs | 56 +++++++++++----------- .../src/transform/check_consts/qualifs.rs | 4 +- 3 files changed, 34 insertions(+), 34 deletions(-) (limited to 'compiler/rustc_const_eval/src/transform') diff --git a/compiler/rustc_const_eval/src/transform/check_consts/check.rs b/compiler/rustc_const_eval/src/transform/check_consts/check.rs index 652f1c94a61..b78924490ca 100644 --- a/compiler/rustc_const_eval/src/transform/check_consts/check.rs +++ b/compiler/rustc_const_eval/src/transform/check_consts/check.rs @@ -1,6 +1,6 @@ //! The `Visitor` responsible for actually checking a `mir::Body` for invalid operations. -use rustc_errors::{Applicability, Diagnostic, ErrorReported}; +use rustc_errors::{Applicability, Diagnostic, ErrorGuaranteed}; use rustc_hir as hir; use rustc_hir::def_id::DefId; use rustc_index::bit_set::BitSet; @@ -121,7 +121,7 @@ impl<'mir, 'tcx> Qualifs<'mir, 'tcx> { fn in_return_place( &mut self, ccx: &'mir ConstCx<'mir, 'tcx>, - tainted_by_errors: Option, + tainted_by_errors: Option, ) -> ConstQualifs { // Find the `Return` terminator if one exists. // @@ -181,7 +181,7 @@ pub struct Checker<'mir, 'tcx> { /// A set that stores for each local whether it has a `StorageDead` for it somewhere. local_has_storage_dead: Option>, - error_emitted: Option, + error_emitted: Option, secondary_errors: Vec, } @@ -329,7 +329,7 @@ impl<'mir, 'tcx> Checker<'mir, 'tcx> { match op.importance() { ops::DiagnosticImportance::Primary => { - self.error_emitted = Some(ErrorReported); + self.error_emitted = Some(ErrorGuaranteed); err.emit(); } diff --git a/compiler/rustc_const_eval/src/transform/check_consts/ops.rs b/compiler/rustc_const_eval/src/transform/check_consts/ops.rs index 5738b38d443..f6b92df92c0 100644 --- a/compiler/rustc_const_eval/src/transform/check_consts/ops.rs +++ b/compiler/rustc_const_eval/src/transform/check_consts/ops.rs @@ -1,6 +1,6 @@ //! Concrete error types for all operations which may be invalid in a certain const context. -use rustc_errors::{struct_span_err, Applicability, DiagnosticBuilder, ErrorReported}; +use rustc_errors::{struct_span_err, Applicability, DiagnosticBuilder, ErrorGuaranteed}; use rustc_hir as hir; use rustc_hir::def_id::DefId; use rustc_infer::infer::TyCtxtInferExt; @@ -51,7 +51,7 @@ pub trait NonConstOp<'tcx>: std::fmt::Debug { &self, ccx: &ConstCx<'_, 'tcx>, span: Span, - ) -> DiagnosticBuilder<'tcx, ErrorReported>; + ) -> DiagnosticBuilder<'tcx, ErrorGuaranteed>; } #[derive(Debug)] @@ -69,7 +69,7 @@ impl<'tcx> NonConstOp<'tcx> for FloatingPointOp { &self, ccx: &ConstCx<'_, 'tcx>, span: Span, - ) -> DiagnosticBuilder<'tcx, ErrorReported> { + ) -> DiagnosticBuilder<'tcx, ErrorGuaranteed> { feature_err( &ccx.tcx.sess.parse_sess, sym::const_fn_floating_point_arithmetic, @@ -87,7 +87,7 @@ impl<'tcx> NonConstOp<'tcx> for FnCallIndirect { &self, ccx: &ConstCx<'_, 'tcx>, span: Span, - ) -> DiagnosticBuilder<'tcx, ErrorReported> { + ) -> DiagnosticBuilder<'tcx, ErrorGuaranteed> { ccx.tcx.sess.struct_span_err(span, "function pointers are not allowed in const fn") } } @@ -107,7 +107,7 @@ impl<'tcx> NonConstOp<'tcx> for FnCallNonConst<'tcx> { &self, ccx: &ConstCx<'_, 'tcx>, _: Span, - ) -> DiagnosticBuilder<'tcx, ErrorReported> { + ) -> DiagnosticBuilder<'tcx, ErrorGuaranteed> { let FnCallNonConst { caller, callee, substs, span, from_hir_call } = *self; let ConstCx { tcx, param_env, .. } = *ccx; @@ -332,7 +332,7 @@ impl<'tcx> NonConstOp<'tcx> for FnCallUnstable { &self, ccx: &ConstCx<'_, 'tcx>, span: Span, - ) -> DiagnosticBuilder<'tcx, ErrorReported> { + ) -> DiagnosticBuilder<'tcx, ErrorGuaranteed> { let FnCallUnstable(def_id, feature) = *self; let mut err = ccx.tcx.sess.struct_span_err( @@ -370,7 +370,7 @@ impl<'tcx> NonConstOp<'tcx> for FnPtrCast { &self, ccx: &ConstCx<'_, 'tcx>, span: Span, - ) -> DiagnosticBuilder<'tcx, ErrorReported> { + ) -> DiagnosticBuilder<'tcx, ErrorGuaranteed> { feature_err( &ccx.tcx.sess.parse_sess, sym::const_fn_fn_ptr_basics, @@ -395,7 +395,7 @@ impl<'tcx> NonConstOp<'tcx> for Generator { &self, ccx: &ConstCx<'_, 'tcx>, span: Span, - ) -> DiagnosticBuilder<'tcx, ErrorReported> { + ) -> DiagnosticBuilder<'tcx, ErrorGuaranteed> { let msg = format!("{}s are not allowed in {}s", self.0, ccx.const_kind()); if let hir::GeneratorKind::Async(hir::AsyncGeneratorKind::Block) = self.0 { feature_err(&ccx.tcx.sess.parse_sess, sym::const_async_blocks, span, &msg) @@ -412,7 +412,7 @@ impl<'tcx> NonConstOp<'tcx> for HeapAllocation { &self, ccx: &ConstCx<'_, 'tcx>, span: Span, - ) -> DiagnosticBuilder<'tcx, ErrorReported> { + ) -> DiagnosticBuilder<'tcx, ErrorGuaranteed> { let mut err = struct_span_err!( ccx.tcx.sess, span, @@ -440,7 +440,7 @@ impl<'tcx> NonConstOp<'tcx> for InlineAsm { &self, ccx: &ConstCx<'_, 'tcx>, span: Span, - ) -> DiagnosticBuilder<'tcx, ErrorReported> { + ) -> DiagnosticBuilder<'tcx, ErrorGuaranteed> { struct_span_err!( ccx.tcx.sess, span, @@ -460,7 +460,7 @@ impl<'tcx> NonConstOp<'tcx> for LiveDrop { &self, ccx: &ConstCx<'_, 'tcx>, span: Span, - ) -> DiagnosticBuilder<'tcx, ErrorReported> { + ) -> DiagnosticBuilder<'tcx, ErrorGuaranteed> { let mut err = struct_span_err!( ccx.tcx.sess, span, @@ -492,7 +492,7 @@ impl<'tcx> NonConstOp<'tcx> for TransientCellBorrow { &self, ccx: &ConstCx<'_, 'tcx>, span: Span, - ) -> DiagnosticBuilder<'tcx, ErrorReported> { + ) -> DiagnosticBuilder<'tcx, ErrorGuaranteed> { feature_err( &ccx.tcx.sess.parse_sess, sym::const_refs_to_cell, @@ -512,7 +512,7 @@ impl<'tcx> NonConstOp<'tcx> for CellBorrow { &self, ccx: &ConstCx<'_, 'tcx>, span: Span, - ) -> DiagnosticBuilder<'tcx, ErrorReported> { + ) -> DiagnosticBuilder<'tcx, ErrorGuaranteed> { let mut err = struct_span_err!( ccx.tcx.sess, span, @@ -563,7 +563,7 @@ impl<'tcx> NonConstOp<'tcx> for MutBorrow { &self, ccx: &ConstCx<'_, 'tcx>, span: Span, - ) -> DiagnosticBuilder<'tcx, ErrorReported> { + ) -> DiagnosticBuilder<'tcx, ErrorGuaranteed> { let raw = match self.0 { hir::BorrowKind::Raw => "raw ", hir::BorrowKind::Ref => "", @@ -606,7 +606,7 @@ impl<'tcx> NonConstOp<'tcx> for TransientMutBorrow { &self, ccx: &ConstCx<'_, 'tcx>, span: Span, - ) -> DiagnosticBuilder<'tcx, ErrorReported> { + ) -> DiagnosticBuilder<'tcx, ErrorGuaranteed> { let raw = match self.0 { hir::BorrowKind::Raw => "raw ", hir::BorrowKind::Ref => "", @@ -637,7 +637,7 @@ impl<'tcx> NonConstOp<'tcx> for MutDeref { &self, ccx: &ConstCx<'_, 'tcx>, span: Span, - ) -> DiagnosticBuilder<'tcx, ErrorReported> { + ) -> DiagnosticBuilder<'tcx, ErrorGuaranteed> { feature_err( &ccx.tcx.sess.parse_sess, sym::const_mut_refs, @@ -655,7 +655,7 @@ impl<'tcx> NonConstOp<'tcx> for PanicNonStr { &self, ccx: &ConstCx<'_, 'tcx>, span: Span, - ) -> DiagnosticBuilder<'tcx, ErrorReported> { + ) -> DiagnosticBuilder<'tcx, ErrorGuaranteed> { ccx.tcx.sess.struct_span_err( span, "argument to `panic!()` in a const context must have type `&str`", @@ -673,7 +673,7 @@ impl<'tcx> NonConstOp<'tcx> for RawPtrComparison { &self, ccx: &ConstCx<'_, 'tcx>, span: Span, - ) -> DiagnosticBuilder<'tcx, ErrorReported> { + ) -> DiagnosticBuilder<'tcx, ErrorGuaranteed> { let mut err = ccx .tcx .sess @@ -697,7 +697,7 @@ impl<'tcx> NonConstOp<'tcx> for RawMutPtrDeref { &self, ccx: &ConstCx<'_, 'tcx>, span: Span, - ) -> DiagnosticBuilder<'tcx, ErrorReported> { + ) -> DiagnosticBuilder<'tcx, ErrorGuaranteed> { feature_err( &ccx.tcx.sess.parse_sess, sym::const_mut_refs, @@ -717,7 +717,7 @@ impl<'tcx> NonConstOp<'tcx> for RawPtrToIntCast { &self, ccx: &ConstCx<'_, 'tcx>, span: Span, - ) -> DiagnosticBuilder<'tcx, ErrorReported> { + ) -> DiagnosticBuilder<'tcx, ErrorGuaranteed> { let mut err = ccx .tcx .sess @@ -746,7 +746,7 @@ impl<'tcx> NonConstOp<'tcx> for StaticAccess { &self, ccx: &ConstCx<'_, 'tcx>, span: Span, - ) -> DiagnosticBuilder<'tcx, ErrorReported> { + ) -> DiagnosticBuilder<'tcx, ErrorGuaranteed> { let mut err = struct_span_err!( ccx.tcx.sess, span, @@ -776,7 +776,7 @@ impl<'tcx> NonConstOp<'tcx> for ThreadLocalAccess { &self, ccx: &ConstCx<'_, 'tcx>, span: Span, - ) -> DiagnosticBuilder<'tcx, ErrorReported> { + ) -> DiagnosticBuilder<'tcx, ErrorGuaranteed> { struct_span_err!( ccx.tcx.sess, span, @@ -811,7 +811,7 @@ pub mod ty { &self, ccx: &ConstCx<'_, 'tcx>, span: Span, - ) -> DiagnosticBuilder<'tcx, ErrorReported> { + ) -> DiagnosticBuilder<'tcx, ErrorGuaranteed> { feature_err( &ccx.tcx.sess.parse_sess, sym::const_mut_refs, @@ -845,7 +845,7 @@ pub mod ty { &self, ccx: &ConstCx<'_, 'tcx>, span: Span, - ) -> DiagnosticBuilder<'tcx, ErrorReported> { + ) -> DiagnosticBuilder<'tcx, ErrorGuaranteed> { feature_err( &ccx.tcx.sess.parse_sess, sym::const_fn_fn_ptr_basics, @@ -866,7 +866,7 @@ pub mod ty { &self, ccx: &ConstCx<'_, 'tcx>, span: Span, - ) -> DiagnosticBuilder<'tcx, ErrorReported> { + ) -> DiagnosticBuilder<'tcx, ErrorGuaranteed> { feature_err( &ccx.tcx.sess.parse_sess, sym::const_impl_trait, @@ -900,7 +900,7 @@ pub mod ty { &self, ccx: &ConstCx<'_, 'tcx>, span: Span, - ) -> DiagnosticBuilder<'tcx, ErrorReported> { + ) -> DiagnosticBuilder<'tcx, ErrorGuaranteed> { let mut err = feature_err( &ccx.tcx.sess.parse_sess, sym::const_fn_trait_bound, @@ -943,7 +943,7 @@ pub mod ty { &self, ccx: &ConstCx<'_, 'tcx>, span: Span, - ) -> DiagnosticBuilder<'tcx, ErrorReported> { + ) -> DiagnosticBuilder<'tcx, ErrorGuaranteed> { let mut err = feature_err( &ccx.tcx.sess.parse_sess, sym::const_fn_trait_bound, @@ -974,7 +974,7 @@ pub mod ty { &self, ccx: &ConstCx<'_, 'tcx>, span: Span, - ) -> DiagnosticBuilder<'tcx, ErrorReported> { + ) -> DiagnosticBuilder<'tcx, ErrorGuaranteed> { feature_err( &ccx.tcx.sess.parse_sess, sym::const_trait_bound_opt_out, diff --git a/compiler/rustc_const_eval/src/transform/check_consts/qualifs.rs b/compiler/rustc_const_eval/src/transform/check_consts/qualifs.rs index 639b798be54..6421ba9df0f 100644 --- a/compiler/rustc_const_eval/src/transform/check_consts/qualifs.rs +++ b/compiler/rustc_const_eval/src/transform/check_consts/qualifs.rs @@ -2,7 +2,7 @@ //! //! See the `Qualif` trait for more info. -use rustc_errors::ErrorReported; +use rustc_errors::ErrorGuaranteed; use rustc_infer::infer::TyCtxtInferExt; use rustc_infer::traits::TraitEngine; use rustc_middle::mir::*; @@ -17,7 +17,7 @@ use super::ConstCx; pub fn in_any_value_of_ty<'tcx>( cx: &ConstCx<'_, 'tcx>, ty: Ty<'tcx>, - tainted_by_errors: Option, + tainted_by_errors: Option, ) -> ConstQualifs { ConstQualifs { has_mut_interior: HasMutInterior::in_any_value_of_ty(cx, ty), -- cgit 1.4.1-3-g733a5