summaryrefslogtreecommitdiffstats
path: root/src/librustc_mir/interpret/step.rs
diff options
context:
space:
mode:
authorOliver Schneider <oli-obk@users.noreply.github.com>2018-04-15 13:28:15 +0200
committerGitHub <noreply@github.com>2018-04-15 13:28:15 +0200
commit907df8c0f7fd5ce07495010d3c0dd112f825d2fe (patch)
treebbeb464b8941c9e0f5d2a5073a6803ecdaa0817a /src/librustc_mir/interpret/step.rs
parentDon't abort const eval due to long running evals, just warn (diff)
downloadgrust-907df8c0f7fd5ce07495010d3c0dd112f825d2fe.tar.gz
grust-907df8c0f7fd5ce07495010d3c0dd112f825d2fe.tar.bz2
grust-907df8c0f7fd5ce07495010d3c0dd112f825d2fe.tar.xz
Add a tracking issue for making the warning a lint
Diffstat (limited to 'src/librustc_mir/interpret/step.rs')
-rw-r--r--src/librustc_mir/interpret/step.rs1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/librustc_mir/interpret/step.rs b/src/librustc_mir/interpret/step.rs
index f891d2b8cc..554d87a04e 100644
--- a/src/librustc_mir/interpret/step.rs
+++ b/src/librustc_mir/interpret/step.rs
@@ -11,6 +11,7 @@ impl<'a, 'mir, 'tcx, M: Machine<'mir, 'tcx>> EvalContext<'a, 'mir, 'tcx, M> {
11 pub fn inc_step_counter_and_check_limit(&mut self, n: usize) { 11 pub fn inc_step_counter_and_check_limit(&mut self, n: usize) {
12 self.terminators_remaining = self.terminators_remaining.saturating_sub(n); 12 self.terminators_remaining = self.terminators_remaining.saturating_sub(n);
13 if self.terminators_remaining == 0 { 13 if self.terminators_remaining == 0 {
14 // FIXME(#49980): make this warning a lint
14 self.tcx.sess.span_warn(self.frame().span, "Constant evaluating a complex constant, this might take some time"); 15 self.tcx.sess.span_warn(self.frame().span, "Constant evaluating a complex constant, this might take some time");
15 self.terminators_remaining = 1_000_000; 16 self.terminators_remaining = 1_000_000;
16 } 17 }