mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-10-01 22:31:43 +00:00
Implement recursion in mir interpreter without recursion
This commit is contained in:
parent
3a1054fc1c
commit
4a444e768c
15 changed files with 432 additions and 264 deletions
|
@ -16,7 +16,7 @@ mod intrinsics;
|
|||
|
||||
fn simplify(e: ConstEvalError) -> ConstEvalError {
|
||||
match e {
|
||||
ConstEvalError::MirEvalError(MirEvalError::InFunction(_, e, _, _)) => {
|
||||
ConstEvalError::MirEvalError(MirEvalError::InFunction(e, _)) => {
|
||||
simplify(ConstEvalError::MirEvalError(*e))
|
||||
}
|
||||
_ => e,
|
||||
|
@ -2471,7 +2471,7 @@ fn exec_limits() {
|
|||
}
|
||||
const GOAL: i32 = f(0);
|
||||
"#,
|
||||
|e| e == ConstEvalError::MirEvalError(MirEvalError::StackOverflow),
|
||||
|e| e == ConstEvalError::MirEvalError(MirEvalError::ExecutionLimitExceeded),
|
||||
);
|
||||
// Reasonable code should still work
|
||||
check_number(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue