Skip to content

Commit 4f0ab6c

Browse files
committed
code review fixes
1 parent eeb2335 commit 4f0ab6c

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

src/librustc/mir/interpret/error.rs

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -321,16 +321,20 @@ pub enum InvalidProgramInfo<'tcx> {
321321
ReferencedConstant,
322322
/// Abort in case type errors are reached
323323
TypeckError,
324+
/// An error occurred during layout computation.
324325
Layout(layout::LayoutError<'tcx>),
325326
}
326327

327328
#[derive(Clone, RustcEncodable, RustcDecodable, HashStable)]
328329
pub enum UndefinedBehaviourInfo {
330+
/// Handle cases which for which we do not have a fixed variant
331+
Ub(String),
329332
Unreachable,
330333
}
331334

332335
#[derive(Clone, RustcEncodable, RustcDecodable, HashStable)]
333336
pub enum UnsupportedInfo<'tcx> {
337+
Unimplemented(String),
334338
FunctionAbiMismatch(Abi, Abi),
335339
FunctionArgMismatch(Ty<'tcx>, Ty<'tcx>),
336340
FunctionRetMismatch(Ty<'tcx>, Ty<'tcx>),
@@ -362,12 +366,6 @@ pub enum UnsupportedInfo<'tcx> {
362366
/// This variant is used by machines to signal their own errors that do not
363367
/// match an existing variant.
364368
MachineError(String),
365-
366-
/// Not actually an interpreter error -- used to signal that execution has exited
367-
/// with the given status code. Used by Miri, but not by CTFE.
368-
Exit(i32),
369-
370-
Unimplemented(String),
371369
DerefFunctionPointer,
372370
ExecuteMemory,
373371
Intrinsic(String),
@@ -416,6 +414,9 @@ pub enum InterpError<'tcx> {
416414
/// The program exhausted the interpreter's resources (stack/heap too big,
417415
/// execution takes too long, ..).
418416
ResourceExhaustion(ResourceExhaustionInfo),
417+
/// Not actually an interpreter error -- used to signal that execution has exited
418+
/// with the given status code. Used by Miri, but not by CTFE.
419+
Exit(i32),
419420
}
420421

421422
pub type InterpResult<'tcx, T = ()> = Result<T, InterpErrorInfo<'tcx>>;

0 commit comments

Comments
 (0)