Rename TimeLimitReached -> StepLimitReached
This commit is contained in:
parent
044dc6e8dd
commit
b5636b8437
5 changed files with 8 additions and 6 deletions
|
|
@ -568,7 +568,7 @@ pub enum ResourceExhaustionInfo {
|
|||
/// The program ran for too long.
|
||||
///
|
||||
/// The exact limit is set by the `const_eval_limit` attribute.
|
||||
TimeLimitReached,
|
||||
StepLimitReached,
|
||||
}
|
||||
|
||||
impl fmt::Debug for ResourceExhaustionInfo {
|
||||
|
|
@ -578,7 +578,9 @@ impl fmt::Debug for ResourceExhaustionInfo {
|
|||
StackFrameLimitReached => {
|
||||
write!(f, "reached the configured maximum number of stack frames")
|
||||
}
|
||||
TimeLimitReached => write!(f, "exceeded interpreter time limit"),
|
||||
StepLimitReached => {
|
||||
write!(f, "exceeded interpreter step limit (see `#[const_eval_limit]`)")
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -335,7 +335,7 @@ impl<'mir, 'tcx> interpret::Machine<'mir, 'tcx> for CompileTimeInterpreter {
|
|||
|
||||
ecx.machine.steps_remaining -= 1;
|
||||
if ecx.machine.steps_remaining == 0 {
|
||||
throw_exhaust!(TimeLimitReached)
|
||||
throw_exhaust!(StepLimitReached)
|
||||
}
|
||||
|
||||
Ok(())
|
||||
|
|
|
|||
|
|
@ -26,7 +26,7 @@ error[E0080]: evaluation of constant value failed
|
|||
--> $DIR/infinite_loop.rs:8:20
|
||||
|
|
||||
LL | n = if n % 2 == 0 { n/2 } else { 3*n + 1 };
|
||||
| ^^^^^^^^^^ exceeded interpreter time limit
|
||||
| ^^^^^^^^^^ exceeded interpreter step limit (see `#[const_eval_limit]`)
|
||||
|
||||
error: aborting due to 3 previous errors
|
||||
|
||||
|
|
|
|||
|
|
@ -16,7 +16,7 @@ error[E0080]: evaluation of constant value failed
|
|||
--> $DIR/issue-52475.rs:7:17
|
||||
|
|
||||
LL | n = (n + 1) % 5;
|
||||
| ^^^^^^^^^^^ exceeded interpreter time limit
|
||||
| ^^^^^^^^^^^ exceeded interpreter step limit (see `#[const_eval_limit]`)
|
||||
|
||||
error: aborting due to 2 previous errors
|
||||
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@ error: any use of this value will cause an error
|
|||
LL | / const X: usize = {
|
||||
LL | | let mut x = 0;
|
||||
LL | | while x != 1000 {
|
||||
| | ^^^^^^^^^ exceeded interpreter time limit
|
||||
| | ^^^^^^^^^ exceeded interpreter step limit (see `#[const_eval_limit]`)
|
||||
LL | |
|
||||
... |
|
||||
LL | | x
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue