diff options
| author | John Kåre Alsaker <john.kare.alsaker@gmail.com> | 2018-04-01 08:19:50 +0200 |
|---|---|---|
| committer | John Kåre Alsaker <john.kare.alsaker@gmail.com> | 2018-04-10 14:40:25 +0200 |
| commit | a23e90a6ded12faff52515918ea7da16e40f5166 (patch) | |
| tree | ae0209d3b3c1970f03a5f60ed35da34f2d60366e | |
| parent | 753cd9a12c64bf504ae2bfdc3a676a28d8076793 (diff) | |
| download | rust-a23e90a6ded12faff52515918ea7da16e40f5166.tar.gz rust-a23e90a6ded12faff52515918ea7da16e40f5166.zip | |
Remove Cell from const_eval_stack_frame_limit and const_eval_step_limit
| -rw-r--r-- | src/librustc/session/mod.rs | 8 | ||||
| -rw-r--r-- | src/librustc_mir/interpret/eval_context.rs | 4 |
2 files changed, 6 insertions, 6 deletions
diff --git a/src/librustc/session/mod.rs b/src/librustc/session/mod.rs index 80e91db15ed..d02c2bbb810 100644 --- a/src/librustc/session/mod.rs +++ b/src/librustc/session/mod.rs @@ -111,9 +111,9 @@ pub struct Session { pub type_length_limit: Once<usize>, /// The maximum number of stackframes allowed in const eval - pub const_eval_stack_frame_limit: Cell<usize>, + pub const_eval_stack_frame_limit: usize, /// The maximum number miri steps per constant - pub const_eval_step_limit: Cell<usize>, + pub const_eval_step_limit: usize, /// The metadata::creader module may inject an allocator/panic_runtime /// dependency if it didn't already find one, and this tracks what was @@ -1110,8 +1110,8 @@ pub fn build_session_( features: RefCell::new(None), recursion_limit: Once::new(), type_length_limit: Once::new(), - const_eval_stack_frame_limit: Cell::new(100), - const_eval_step_limit: Cell::new(1_000_000), + const_eval_stack_frame_limit: 100, + const_eval_step_limit: 1_000_000, next_node_id: Cell::new(NodeId::new(1)), injected_allocator: Cell::new(None), allocator_kind: Cell::new(None), diff --git a/src/librustc_mir/interpret/eval_context.rs b/src/librustc_mir/interpret/eval_context.rs index 3220d4d96b3..58ea8d48e97 100644 --- a/src/librustc_mir/interpret/eval_context.rs +++ b/src/librustc_mir/interpret/eval_context.rs @@ -194,8 +194,8 @@ impl<'a, 'mir, 'tcx: 'mir, M: Machine<'mir, 'tcx>> EvalContext<'a, 'mir, 'tcx, M param_env, memory: Memory::new(tcx, memory_data), stack: Vec::new(), - stack_limit: tcx.sess.const_eval_stack_frame_limit.get(), - steps_remaining: tcx.sess.const_eval_step_limit.get(), + stack_limit: tcx.sess.const_eval_stack_frame_limit, + steps_remaining: tcx.sess.const_eval_step_limit, } } |
