ICE using const_generics
feature
#82956
Labels
A-const-generics
Area: const generics (parameters and arguments)
C-bug
Category: This is a bug.
E-needs-test
Call for participation: An issue has been fixed and does not reproduce, but no test has been added.
glacier
ICE tracked in rust-lang/glacier.
I-ICE
Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
hi its me again with another ice
Code
I encountered this error when working on a library for treating arrays/tuples a bit more like vectors by providing
.push(val)
and.pop()
methods through trait impls. I implemented this on stable using a mcschnasty proc macro, but for nightly I tried spicing things up a bit and implementing it using theconst_generics
feature (andconst_evaluatable_checked
andarray_map
). In short, though, the code boils down to this (onlyOrdesDec
included since I dunno ifOrdesInc
causes an ICE or not):The issue occurs specifically when
.pop()
is used in doc tests or another crate and when it's called in a manner similar to this:The ICE also occurs when
foo
is defined likelet foo = ['a', 'b', 'c', 'd', 'e'];
etc. However, it works just fine in#[test]
functions in the crate it's defined in.Meta
rustc --version --verbose
:Error output
Backtrace
Here, I even did `RUST_BACKTRACE=full cargo test` for this one:
Notes
I believe this may be somewhat related to #79018 or #82835, but I'm not certain, since the issue I'm having only occurs when
OrdesDec::pop()
is used outside of theordes
crate.The text was updated successfully, but these errors were encountered: