forked from rust-lang/rust
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Rollup merge of rust-lang#130665 - veera-sivarajan:fix-118612, r=comp…
…iler-errors Prevent Deduplication of `LongRunningWarn` Fixes rust-lang#118612 As mention in the issue, `LongRunningWarn` is meant to be repeated multiple times. Therefore, this PR stores a unique number in every instance of `LongRunningWarn` so that it's not hashed into the same value and omitted by the deduplication mechanism.
- Loading branch information
Showing
4 changed files
with
126 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
24 changes: 24 additions & 0 deletions
24
tests/ui/consts/const-eval/stable-metric/evade-deduplication-issue-118612.rs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
//@ check-pass | ||
|
||
#![allow(long_running_const_eval)] | ||
|
||
//@ compile-flags: -Z tiny-const-eval-limit -Z deduplicate-diagnostics=yes | ||
const FOO: () = { | ||
let mut i = 0; | ||
loop { | ||
//~^ WARN is taking a long time | ||
//~| WARN is taking a long time | ||
//~| WARN is taking a long time | ||
//~| WARN is taking a long time | ||
//~| WARN is taking a long time | ||
if i == 1000 { | ||
break; | ||
} else { | ||
i += 1; | ||
} | ||
} | ||
}; | ||
|
||
fn main() { | ||
FOO | ||
} |
92 changes: 92 additions & 0 deletions
92
tests/ui/consts/const-eval/stable-metric/evade-deduplication-issue-118612.stderr
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,92 @@ | ||
warning: constant evaluation is taking a long time | ||
--> $DIR/evade-deduplication-issue-118612.rs:8:5 | ||
| | ||
LL | / loop { | ||
LL | | | ||
LL | | | ||
LL | | | ||
... | | ||
LL | | } | ||
LL | | } | ||
| |_____^ the const evaluator is currently interpreting this expression | ||
| | ||
help: the constant being evaluated | ||
--> $DIR/evade-deduplication-issue-118612.rs:6:1 | ||
| | ||
LL | const FOO: () = { | ||
| ^^^^^^^^^^^^^ | ||
|
||
warning: constant evaluation is taking a long time | ||
--> $DIR/evade-deduplication-issue-118612.rs:8:5 | ||
| | ||
LL | / loop { | ||
LL | | | ||
LL | | | ||
LL | | | ||
... | | ||
LL | | } | ||
LL | | } | ||
| |_____^ the const evaluator is currently interpreting this expression | ||
| | ||
help: the constant being evaluated | ||
--> $DIR/evade-deduplication-issue-118612.rs:6:1 | ||
| | ||
LL | const FOO: () = { | ||
| ^^^^^^^^^^^^^ | ||
|
||
warning: constant evaluation is taking a long time | ||
--> $DIR/evade-deduplication-issue-118612.rs:8:5 | ||
| | ||
LL | / loop { | ||
LL | | | ||
LL | | | ||
LL | | | ||
... | | ||
LL | | } | ||
LL | | } | ||
| |_____^ the const evaluator is currently interpreting this expression | ||
| | ||
help: the constant being evaluated | ||
--> $DIR/evade-deduplication-issue-118612.rs:6:1 | ||
| | ||
LL | const FOO: () = { | ||
| ^^^^^^^^^^^^^ | ||
|
||
warning: constant evaluation is taking a long time | ||
--> $DIR/evade-deduplication-issue-118612.rs:8:5 | ||
| | ||
LL | / loop { | ||
LL | | | ||
LL | | | ||
LL | | | ||
... | | ||
LL | | } | ||
LL | | } | ||
| |_____^ the const evaluator is currently interpreting this expression | ||
| | ||
help: the constant being evaluated | ||
--> $DIR/evade-deduplication-issue-118612.rs:6:1 | ||
| | ||
LL | const FOO: () = { | ||
| ^^^^^^^^^^^^^ | ||
|
||
warning: constant evaluation is taking a long time | ||
--> $DIR/evade-deduplication-issue-118612.rs:8:5 | ||
| | ||
LL | / loop { | ||
LL | | | ||
LL | | | ||
LL | | | ||
... | | ||
LL | | } | ||
LL | | } | ||
| |_____^ the const evaluator is currently interpreting this expression | ||
| | ||
help: the constant being evaluated | ||
--> $DIR/evade-deduplication-issue-118612.rs:6:1 | ||
| | ||
LL | const FOO: () = { | ||
| ^^^^^^^^^^^^^ | ||
|
||
warning: 5 warnings emitted | ||
|