Skip to content
This repository was archived by the owner on May 28, 2025. It is now read-only.

Commit 70612b7

Browse files
committed
reorganize tests a bit
1 parent e7f4399 commit 70612b7

17 files changed

+20
-9
lines changed

tests/ui/consts/monomorphization/dead-code-in-called-fn.rs renamed to tests/ui/consts/required-consts/dead-code-in-called-fn.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ impl<T> Fail<T> {
1313
fn called<T>() {
1414
// Any function that is called is guaranteed to have all consts that syntactically
1515
// appear in its body evaluated, even if they only appear in dead code.
16+
// This relies on mono-item collection checking `required_consts` in collected functions.
1617
if false {
1718
let _ = Fail::<T>::C;
1819
}

tests/ui/consts/monomorphization/dead-code-in-const-called-fn.no-opt.stderr renamed to tests/ui/consts/required-consts/dead-code-in-const-called-fn.no-opt.stderr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ LL | const C: () = panic!();
77
= note: this error originates in the macro `$crate::panic::panic_2015` which comes from the expansion of the macro `panic` (in Nightly builds, run with -Z macro-backtrace for more info)
88

99
note: erroneous constant encountered
10-
--> $DIR/dead-code-in-const-called-fn.rs:16:9
10+
--> $DIR/dead-code-in-const-called-fn.rs:17:9
1111
|
1212
LL | Fail::<T>::C;
1313
| ^^^^^^^^^^^^

tests/ui/consts/monomorphization/dead-code-in-const-called-fn.opt.stderr renamed to tests/ui/consts/required-consts/dead-code-in-const-called-fn.opt.stderr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ LL | const C: () = panic!();
77
= note: this error originates in the macro `$crate::panic::panic_2015` which comes from the expansion of the macro `panic` (in Nightly builds, run with -Z macro-backtrace for more info)
88

99
note: erroneous constant encountered
10-
--> $DIR/dead-code-in-const-called-fn.rs:16:9
10+
--> $DIR/dead-code-in-const-called-fn.rs:17:9
1111
|
1212
LL | Fail::<T>::C;
1313
| ^^^^^^^^^^^^

tests/ui/consts/monomorphization/dead-code-in-const-called-fn.rs renamed to tests/ui/consts/required-consts/dead-code-in-const-called-fn.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ const fn no_codegen<T>() {
1313
if false {
1414
// This bad constant is only used in dead code in a no-codegen function... and yet we still
1515
// must make sure that the build fails.
16+
// This relies on const-eval evaluating all `required_consts` of `const fn`.
1617
Fail::<T>::C; //~ constant
1718
}
1819
}

0 commit comments

Comments
 (0)