Skip to content

Commit

Permalink
Unrolled build for rust-lang#130730
Browse files Browse the repository at this point in the history
Rollup merge of rust-lang#130730 - veera-sivarajan:clean-test-headers, r=compiler-errors

Reorganize Test Headers

This PR moves the test headers to the top in a couple of test files to maintain consistent style.

Based on this comment: rust-lang#130665 (comment)
  • Loading branch information
rust-timer authored Sep 28, 2024
2 parents fa724e5 + 8cf861d commit a388267
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 11 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
warning: constant evaluation is taking a long time
--> $DIR/ctfe-simple-loop.rs:9:5
--> $DIR/ctfe-simple-loop.rs:10:5
|
LL | / while index < n {
LL | |
Expand All @@ -10,7 +10,7 @@ LL | | }
| |_____^ the const evaluator is currently interpreting this expression
|
help: the constant being evaluated
--> $DIR/ctfe-simple-loop.rs:19:1
--> $DIR/ctfe-simple-loop.rs:20:1
|
LL | const Y: u32 = simple_loop(35);
| ^^^^^^^^^^^^
Expand Down
3 changes: 2 additions & 1 deletion tests/ui/consts/const-eval/stable-metric/ctfe-simple-loop.rs
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
//@ check-pass
//@ revisions: warn allow
//@ compile-flags: -Z tiny-const-eval-limit

#![cfg_attr(warn, warn(long_running_const_eval))]
#![cfg_attr(allow, allow(long_running_const_eval))]

//@ compile-flags: -Z tiny-const-eval-limit
const fn simple_loop(n: u32) -> u32 {
let mut index = 0;
while index < n {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
warning: constant evaluation is taking a long time
--> $DIR/ctfe-simple-loop.rs:9:5
--> $DIR/ctfe-simple-loop.rs:10:5
|
LL | / while index < n {
LL | |
Expand All @@ -12,18 +12,18 @@ LL | | }
= note: this lint makes sure the compiler doesn't get stuck due to infinite loops in const eval.
If your compilation actually takes a long time, you can safely allow the lint.
help: the constant being evaluated
--> $DIR/ctfe-simple-loop.rs:18:1
--> $DIR/ctfe-simple-loop.rs:19:1
|
LL | const X: u32 = simple_loop(19);
| ^^^^^^^^^^^^
note: the lint level is defined here
--> $DIR/ctfe-simple-loop.rs:3:24
--> $DIR/ctfe-simple-loop.rs:5:24
|
LL | #![cfg_attr(warn, warn(long_running_const_eval))]
| ^^^^^^^^^^^^^^^^^^^^^^^

warning: constant evaluation is taking a long time
--> $DIR/ctfe-simple-loop.rs:9:5
--> $DIR/ctfe-simple-loop.rs:10:5
|
LL | / while index < n {
LL | |
Expand All @@ -36,13 +36,13 @@ LL | | }
= note: this lint makes sure the compiler doesn't get stuck due to infinite loops in const eval.
If your compilation actually takes a long time, you can safely allow the lint.
help: the constant being evaluated
--> $DIR/ctfe-simple-loop.rs:19:1
--> $DIR/ctfe-simple-loop.rs:20:1
|
LL | const Y: u32 = simple_loop(35);
| ^^^^^^^^^^^^

warning: constant evaluation is taking a long time
--> $DIR/ctfe-simple-loop.rs:9:5
--> $DIR/ctfe-simple-loop.rs:10:5
|
LL | / while index < n {
LL | |
Expand All @@ -53,7 +53,7 @@ LL | | }
| |_____^ the const evaluator is currently interpreting this expression
|
help: the constant being evaluated
--> $DIR/ctfe-simple-loop.rs:19:1
--> $DIR/ctfe-simple-loop.rs:20:1
|
LL | const Y: u32 = simple_loop(35);
| ^^^^^^^^^^^^
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
//@ check-pass
//@ compile-flags: -Z tiny-const-eval-limit -Z deduplicate-diagnostics=yes

#![allow(long_running_const_eval)]

//@ compile-flags: -Z tiny-const-eval-limit -Z deduplicate-diagnostics=yes
const FOO: () = {
let mut i = 0;
loop {
Expand Down

0 comments on commit a388267

Please sign in to comment.