-
Notifications
You must be signed in to change notification settings - Fork 12.8k
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 caused by using a const_generic fn from a trait or impl #63695
Comments
It doesn't have to be in a trait, a regular impl block would do it as well: #![feature(const_generics)]
struct S;
impl S {
fn test<const A: i32>() -> i32 {
A
}
}
fn main() {
S::test::<{ 16i32 }>();
} |
Looks like it's the same ICE at |
It appears that the ICE at For the original snippet:
and for @hellow554 snippet:
Both of these are related to #64537. |
Also seems related to #63695, although the error is different. |
this probably depends on #70125 (comment) |
@rustbot claim |
No longer ICEs as of #70249, could do with a test |
@rustbot release-assignment While the ICE is gone, this is still a bug. probably related to #70167 (comment) |
Current status is that this ICEs again:
|
const generics triage I went through all const generics issues and closed all issues which are already fixed. Some issues already have a regression test but were not closed. Also doing this as part of this PR. uff r? @eddyb @varkor closes rust-lang#61936 closes rust-lang#62878 closes rust-lang#63695 closes rust-lang#67144 closes rust-lang#68596 closes rust-lang#69816 closes rust-lang#70217 closes rust-lang#70507 closes rust-lang#70586 closes rust-lang#71348 closes rust-lang#71805 closes rust-lang#73120 closes rust-lang#73508 closes rust-lang#73730 closes rust-lang#74255
A function that compiles and runs successfully outside of a trait causes an ICE when it's in a trait. The expectation is that this should work similarly to other generics on trait functions--while they will prevent a trait object reference, they should otherwise be allowed. (On playground)
Error and relevant backtrace:
The text was updated successfully, but these errors were encountered: