Skip to content

Commit eeb2335

Browse files
committed
moving remaining variants to UnsupportedInfo
1 parent fc48f3e commit eeb2335

File tree

1 file changed

+22
-25
lines changed

1 file changed

+22
-25
lines changed

src/librustc/mir/interpret/error.rs

Lines changed: 22 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -359,31 +359,6 @@ pub enum UnsupportedInfo<'tcx> {
359359
UnimplementedTraitSelection,
360360
CalledClosureAsFunction,
361361
NoMirFor(String),
362-
}
363-
364-
#[derive(Clone, RustcEncodable, RustcDecodable, HashStable)]
365-
pub enum ResourceExhaustionInfo {
366-
StackFrameLimitReached,
367-
InfiniteLoop,
368-
}
369-
370-
#[derive(Clone, RustcEncodable, RustcDecodable, HashStable)]
371-
pub enum InterpError<'tcx> {
372-
/// The program panicked.
373-
Panic(PanicMessage<u64>),
374-
/// The program caused undefined behavior.
375-
UndefinedBehaviour(UndefinedBehaviourInfo),
376-
/// The program did something the interpreter does not support (some of these *might* be UB
377-
/// but the interpreter is not sure).
378-
Unsupported(UnsupportedInfo<'tcx>),
379-
/// The program was invalid (ill-typed, not sufficiently monomorphized, ...).
380-
InvalidProgram(InvalidProgramInfo<'tcx>),
381-
/// The program exhausted the interpreter's resources (stack/heap too big,
382-
/// execution takes too long, ..).
383-
ResourceExhaustion(ResourceExhaustionInfo),
384-
385-
/// THe above 5 variants are what we want to group all the remaining InterpError variants into
386-
387362
/// This variant is used by machines to signal their own errors that do not
388363
/// match an existing variant.
389364
MachineError(String),
@@ -421,6 +396,28 @@ pub enum InterpError<'tcx> {
421396
PathNotFound(Vec<String>),
422397
}
423398

399+
#[derive(Clone, RustcEncodable, RustcDecodable, HashStable)]
400+
pub enum ResourceExhaustionInfo {
401+
StackFrameLimitReached,
402+
InfiniteLoop,
403+
}
404+
405+
#[derive(Clone, RustcEncodable, RustcDecodable, HashStable)]
406+
pub enum InterpError<'tcx> {
407+
/// The program panicked.
408+
Panic(PanicMessage<u64>),
409+
/// The program caused undefined behavior.
410+
UndefinedBehaviour(UndefinedBehaviourInfo),
411+
/// The program did something the interpreter does not support (some of these *might* be UB
412+
/// but the interpreter is not sure).
413+
Unsupported(UnsupportedInfo<'tcx>),
414+
/// The program was invalid (ill-typed, not sufficiently monomorphized, ...).
415+
InvalidProgram(InvalidProgramInfo<'tcx>),
416+
/// The program exhausted the interpreter's resources (stack/heap too big,
417+
/// execution takes too long, ..).
418+
ResourceExhaustion(ResourceExhaustionInfo),
419+
}
420+
424421
pub type InterpResult<'tcx, T = ()> = Result<T, InterpErrorInfo<'tcx>>;
425422

426423
impl fmt::Display for InterpError<'_> {

0 commit comments

Comments
 (0)