-
Notifications
You must be signed in to change notification settings - Fork 13.1k
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
ICE: evaluation of constant value failed | #[inline] causes compiler panic when bench-marking #83937
Comments
We now have the ability to profile our sorting algorithms and compare them to the std sorting algorithms. Unfortunately, there seems to be a bug in the compiler (rust-lang/rust#83937), that currently prevents using #[inline] on some sort functions when benchmarking (see issue for more information). Therefore we now have a `is_benchmark` feature, that turns these inlines off, when benchmarking.
Issue: rust-lang/rust#83937
Issue: rust-lang/rust#83937
Triage: it now works with the latest nightly, I guess #86166 fixed it. Marking as |
A slight modification is required to reproduce the original issue: --- a/src/lib.rs
+++ b/src/lib.rs
@@ -19,7 +19,8 @@ pub trait CountingSort {
impl CountingSort for [u8] {
#[inline] // when this is removed, everything works well
fn sort(&mut self) {
- let _counts = [0usize; u8::MAX.into_usize() + 1];
+ let _counts = [0usize; u8::MAX.into_usize() * 0];
+ &_counts;
}
} |
Constness of associated functions is encoded & decoded without looking at constness of impl. Encoding a result of rust/compiler/rustc_metadata/src/rmeta/encoder.rs Line 1226 in b6f3cb9
Duplicate of #84846. |
Fixed by #86750. |
I'm currently experimenting with a bunch of sorting algorithms. To reduce boilerplate, I made use of the
const_trait_impl
feature.It seems like this feature breaks when benchmarking an
#[inline]
function. It however works well when not using#[inline]
, or when not benchmarking.Minimal example:
Code
Cargo.toml
benches/counting_sort.rs
Meta
rustc --version --verbose
:Command
Error output
Backtrace
Edit:
rustc note
The text was updated successfully, but these errors were encountered: