-
Notifications
You must be signed in to change notification settings - Fork 12.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Stop hiding const eval limit in external macros
- Loading branch information
Showing
3 changed files
with
42 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
//! This test checks that external macros don't hide | ||
//! the const eval timeout lint and then subsequently | ||
//! ICE. | ||
|
||
// compile-flags: --crate-type=lib -Ztiny-const-eval-limit | ||
// error-pattern: constant evaluation is taking a long time | ||
|
||
static ROOK_ATTACKS_TABLE: () = { | ||
0_u64.count_ones(); | ||
0_u64.count_ones(); | ||
0_u64.count_ones(); | ||
0_u64.count_ones(); | ||
0_u64.count_ones(); | ||
0_u64.count_ones(); | ||
0_u64.count_ones(); | ||
0_u64.count_ones(); | ||
0_u64.count_ones(); | ||
0_u64.count_ones(); | ||
0_u64.count_ones(); | ||
0_u64.count_ones(); | ||
0_u64.count_ones(); | ||
0_u64.count_ones(); | ||
0_u64.count_ones(); | ||
0_u64.count_ones(); | ||
}; |
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,15 @@ | ||
error: constant evaluation is taking a long time | ||
--> $SRC_DIR/core/src/num/mod.rs:LL:COL | ||
| | ||
= 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/timeout.rs:8:1 | ||
| | ||
LL | static ROOK_ATTACKS_TABLE: () = { | ||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ||
= note: `#[deny(long_running_const_eval)]` on by default | ||
= note: this error originates in the macro `uint_impl` (in Nightly builds, run with -Z macro-backtrace for more info) | ||
|
||
error: aborting due to previous error | ||
|