Skip to content

Commit 4d35981

Browse files
committed
Remove unused struct_error function.
1 parent 9560c58 commit 4d35981

File tree

2 files changed

+6
-15
lines changed

2 files changed

+6
-15
lines changed

compiler/rustc_middle/src/mir/interpret/error.rs

+1-9
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,10 @@ use super::{AllocId, AllocRange, Pointer, Scalar};
22

33
use crate::error;
44
use crate::mir::{ConstAlloc, ConstValue};
5-
use crate::query::TyCtxtAt;
65
use crate::ty::{layout, tls, Ty, TyCtxt, ValTree};
76

87
use rustc_data_structures::sync::Lock;
9-
use rustc_errors::{
10-
struct_span_err, DiagnosticArgValue, DiagnosticBuilder, DiagnosticMessage, ErrorGuaranteed,
11-
IntoDiagnosticArg,
12-
};
8+
use rustc_errors::{DiagnosticArgValue, DiagnosticMessage, ErrorGuaranteed, IntoDiagnosticArg};
139
use rustc_macros::HashStable;
1410
use rustc_session::CtfeBacktrace;
1511
use rustc_span::{def_id::DefId, Span, DUMMY_SP};
@@ -90,10 +86,6 @@ pub type EvalToConstValueResult<'tcx> = Result<ConstValue<'tcx>, ErrorHandled>;
9086
/// This is needed in `thir::pattern::lower_inline_const`.
9187
pub type EvalToValTreeResult<'tcx> = Result<Option<ValTree<'tcx>>, ErrorHandled>;
9288

93-
pub fn struct_error<'tcx>(tcx: TyCtxtAt<'tcx>, msg: &str) -> DiagnosticBuilder<'tcx> {
94-
struct_span_err!(tcx.dcx(), tcx.span, E0080, "{}", msg)
95-
}
96-
9789
#[cfg(all(target_arch = "x86_64", target_pointer_width = "64"))]
9890
static_assert_size!(InterpErrorInfo<'_>, 8);
9991

compiler/rustc_middle/src/mir/interpret/mod.rs

+5-6
Original file line numberDiff line numberDiff line change
@@ -142,12 +142,11 @@ use crate::ty::GenericArgKind;
142142
use crate::ty::{self, Instance, Ty, TyCtxt};
143143

144144
pub use self::error::{
145-
struct_error, BadBytesAccess, CheckAlignMsg, CheckInAllocMsg, ErrorHandled,
146-
EvalToAllocationRawResult, EvalToConstValueResult, EvalToValTreeResult, ExpectedKind,
147-
InterpError, InterpErrorInfo, InterpResult, InvalidMetaKind, InvalidProgramInfo,
148-
MachineStopType, Misalignment, PointerKind, ReportedErrorInfo, ResourceExhaustionInfo,
149-
ScalarSizeMismatch, UndefinedBehaviorInfo, UnsupportedOpInfo, ValidationErrorInfo,
150-
ValidationErrorKind,
145+
BadBytesAccess, CheckAlignMsg, CheckInAllocMsg, ErrorHandled, EvalToAllocationRawResult,
146+
EvalToConstValueResult, EvalToValTreeResult, ExpectedKind, InterpError, InterpErrorInfo,
147+
InterpResult, InvalidMetaKind, InvalidProgramInfo, MachineStopType, Misalignment, PointerKind,
148+
ReportedErrorInfo, ResourceExhaustionInfo, ScalarSizeMismatch, UndefinedBehaviorInfo,
149+
UnsupportedOpInfo, ValidationErrorInfo, ValidationErrorKind,
151150
};
152151

153152
pub use self::value::Scalar;

0 commit comments

Comments
 (0)