diff options
| author | mark <markm@cs.wisc.edu> | 2022-01-23 12:34:26 -0600 |
|---|---|---|
| committer | mark <markm@cs.wisc.edu> | 2022-03-02 09:45:25 -0600 |
| commit | e489a94deef3d41513fe4254804d730f0fd6cbc0 (patch) | |
| tree | d2c3743151e614831817cb8c27487a820826cc29 /compiler/rustc_middle/src/mir/interpret/error.rs | |
| parent | c42d846add941a26bd254911e16f02c4a3f9346f (diff) | |
| download | rust-e489a94deef3d41513fe4254804d730f0fd6cbc0.tar.gz rust-e489a94deef3d41513fe4254804d730f0fd6cbc0.zip | |
rename ErrorReported -> ErrorGuaranteed
Diffstat (limited to 'compiler/rustc_middle/src/mir/interpret/error.rs')
| -rw-r--r-- | compiler/rustc_middle/src/mir/interpret/error.rs | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/compiler/rustc_middle/src/mir/interpret/error.rs b/compiler/rustc_middle/src/mir/interpret/error.rs index 31468ce73bf..98cb90296a5 100644 --- a/compiler/rustc_middle/src/mir/interpret/error.rs +++ b/compiler/rustc_middle/src/mir/interpret/error.rs @@ -4,7 +4,7 @@ use crate::mir::interpret::ConstValue; use crate::ty::{layout, query::TyCtxtAt, tls, FnSig, Ty}; use rustc_data_structures::sync::Lock; -use rustc_errors::{pluralize, struct_span_err, DiagnosticBuilder, ErrorReported}; +use rustc_errors::{pluralize, struct_span_err, DiagnosticBuilder, ErrorGuaranteed}; use rustc_macros::HashStable; use rustc_session::CtfeBacktrace; use rustc_span::def_id::DefId; @@ -15,7 +15,7 @@ use std::{any::Any, backtrace::Backtrace, fmt}; pub enum ErrorHandled { /// Already reported an error for this evaluation, and the compilation is /// *guaranteed* to fail. Warnings/lints *must not* produce `Reported`. - Reported(ErrorReported), + Reported(ErrorGuaranteed), /// Already emitted a lint for this evaluation. Linted, /// Don't emit an error, the evaluation failed because the MIR was generic @@ -23,8 +23,8 @@ pub enum ErrorHandled { TooGeneric, } -impl From<ErrorReported> for ErrorHandled { - fn from(err: ErrorReported) -> ErrorHandled { +impl From<ErrorGuaranteed> for ErrorHandled { + fn from(err: ErrorGuaranteed) -> ErrorHandled { ErrorHandled::Reported(err) } } @@ -39,7 +39,7 @@ pub type EvalToConstValueResult<'tcx> = Result<ConstValue<'tcx>, ErrorHandled>; pub fn struct_error<'tcx>( tcx: TyCtxtAt<'tcx>, msg: &str, -) -> DiagnosticBuilder<'tcx, ErrorReported> { +) -> DiagnosticBuilder<'tcx, ErrorGuaranteed> { struct_span_err!(tcx.sess, tcx.span, E0080, "{}", msg) } @@ -91,7 +91,7 @@ fn print_backtrace(backtrace: &Backtrace) { impl From<ErrorHandled> for InterpErrorInfo<'_> { fn from(err: ErrorHandled) -> Self { match err { - ErrorHandled::Reported(ErrorReported) | ErrorHandled::Linted => { + ErrorHandled::Reported(ErrorGuaranteed) | ErrorHandled::Linted => { err_inval!(ReferencedConstant) } ErrorHandled::TooGeneric => err_inval!(TooGeneric), @@ -100,8 +100,8 @@ impl From<ErrorHandled> for InterpErrorInfo<'_> { } } -impl From<ErrorReported> for InterpErrorInfo<'_> { - fn from(err: ErrorReported) -> Self { +impl From<ErrorGuaranteed> for InterpErrorInfo<'_> { + fn from(err: ErrorGuaranteed) -> Self { InterpError::InvalidProgram(InvalidProgramInfo::AlreadyReported(err)).into() } } @@ -141,7 +141,7 @@ pub enum InvalidProgramInfo<'tcx> { /// which already produced an error. ReferencedConstant, /// Abort in case errors are already reported. - AlreadyReported(ErrorReported), + AlreadyReported(ErrorGuaranteed), /// An error occurred during layout computation. Layout(layout::LayoutError<'tcx>), /// An error occurred during FnAbi computation: the passed --target lacks FFI support @@ -160,7 +160,7 @@ impl fmt::Display for InvalidProgramInfo<'_> { match self { TooGeneric => write!(f, "encountered overly generic constant"), ReferencedConstant => write!(f, "referenced constant has errors"), - AlreadyReported(ErrorReported) => { + AlreadyReported(ErrorGuaranteed) => { write!(f, "encountered constants with type errors, stopping evaluation") } Layout(ref err) => write!(f, "{}", err), |
