Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reorganize Test Headers #130730

Merged
merged 1 commit into from
Sep 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading