File tree 2 files changed +44
-0
lines changed
tests/ui/consts/const-eval/stable-metric
2 files changed +44
-0
lines changed Original file line number Diff line number Diff line change
1
+ //@ check-pass
2
+
3
+ #![ allow( long_running_const_eval) ]
4
+
5
+ //@ compile-flags: -Z tiny-const-eval-limit -Z deduplicate-diagnostics=yes
6
+ const FOO : ( ) = {
7
+ let mut i = 0 ;
8
+ loop {
9
+ //~^ WARN is taking a long time
10
+ //~| WARN is taking a long time
11
+ //~| WARN is taking a long time
12
+ //~| WARN is taking a long time
13
+ //~| WARN is taking a long time
14
+ if i == 1000 {
15
+ break ;
16
+ } else {
17
+ i += 1 ;
18
+ }
19
+ }
20
+ } ;
21
+
22
+ fn main ( ) {
23
+ FOO
24
+ }
Original file line number Diff line number Diff line change
1
+ warning: constant evaluation is taking a long time
2
+ --> $DIR/evade-deduplication-issue-118612.rs:8:5
3
+ |
4
+ LL | / loop {
5
+ LL | |
6
+ LL | |
7
+ LL | |
8
+ ... |
9
+ LL | | }
10
+ LL | | }
11
+ | |_____^ the const evaluator is currently interpreting this expression
12
+ |
13
+ help: the constant being evaluated
14
+ --> $DIR/evade-deduplication-issue-118612.rs:6:1
15
+ |
16
+ LL | const FOO: () = {
17
+ | ^^^^^^^^^^^^^
18
+
19
+ warning: 1 warning emitted
20
+
You can’t perform that action at this time.
0 commit comments