Skip to content

Commit a23e90a

Browse files
committed
Remove Cell from const_eval_stack_frame_limit and const_eval_step_limit
1 parent 753cd9a commit a23e90a

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

src/librustc/session/mod.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -111,9 +111,9 @@ pub struct Session {
111111
pub type_length_limit: Once<usize>,
112112

113113
/// The maximum number of stackframes allowed in const eval
114-
pub const_eval_stack_frame_limit: Cell<usize>,
114+
pub const_eval_stack_frame_limit: usize,
115115
/// The maximum number miri steps per constant
116-
pub const_eval_step_limit: Cell<usize>,
116+
pub const_eval_step_limit: usize,
117117

118118
/// The metadata::creader module may inject an allocator/panic_runtime
119119
/// dependency if it didn't already find one, and this tracks what was
@@ -1110,8 +1110,8 @@ pub fn build_session_(
11101110
features: RefCell::new(None),
11111111
recursion_limit: Once::new(),
11121112
type_length_limit: Once::new(),
1113-
const_eval_stack_frame_limit: Cell::new(100),
1114-
const_eval_step_limit: Cell::new(1_000_000),
1113+
const_eval_stack_frame_limit: 100,
1114+
const_eval_step_limit: 1_000_000,
11151115
next_node_id: Cell::new(NodeId::new(1)),
11161116
injected_allocator: Cell::new(None),
11171117
allocator_kind: Cell::new(None),

src/librustc_mir/interpret/eval_context.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -194,8 +194,8 @@ impl<'a, 'mir, 'tcx: 'mir, M: Machine<'mir, 'tcx>> EvalContext<'a, 'mir, 'tcx, M
194194
param_env,
195195
memory: Memory::new(tcx, memory_data),
196196
stack: Vec::new(),
197-
stack_limit: tcx.sess.const_eval_stack_frame_limit.get(),
198-
steps_remaining: tcx.sess.const_eval_step_limit.get(),
197+
stack_limit: tcx.sess.const_eval_stack_frame_limit,
198+
steps_remaining: tcx.sess.const_eval_step_limit,
199199
}
200200
}
201201

0 commit comments

Comments
 (0)