-
Notifications
You must be signed in to change notification settings - Fork 13.3k
ICE: index out of bounds: the len is 0 but the index is 0 #136940
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
Comments
The ICE seems to happen during trait selection when trying to handle higher-rank trait bounds (HRTB) with a trait alias. The empty slice access suggests it might be failing to properly handle the lifetimes or parameters in the trait selection process. Specifically, when evaluating the trait selection: evaluating trait selection obligation `alloc::boxed::Box<(dyn for<'a> core::ops::function::FnOnce(&'a mut T) -> core::pin::Pin<alloc::boxed::Box<(dyn core::future::future::Future<Output = ()> + core::marker::Send + 'a)>> + core::marker::Send + 'b)>: core::ops::function::FnOnce<(^1_1,)>` I am way in over my head here, but I'll build the rust compiler locally and attempt to resolve a fix. Seems the lead we have is the ranking of the trait bounds causing the panic... |
Reduced: #![feature(trait_alias)]
trait FnOnceTrait<'a> = FnOnce(&'a ());
fn g() -> Box<dyn for<'a> FnOnceTrait<'a>> {
todo!()
}
fn main() {
g().foo();
} bisection: bisected with cargo-bisect-rustc v0.6.9Host triple: x86_64-unknown-linux-gnu cargo bisect-rustc --start=2024-12-16 --script=run.sh @rustbot label:S-has-mcve S-has-bisection F-trait_alias |
Great work. That commit in question was a fix pertaining to trait aliases. I've never seen a bisection work so well before 🙂 |
cc @compiler-errors on that bisection |
Use the right binder for rebinding `PolyTraitRef` Fixes rust-lang#136940 I committed a slightly different test which still demonstrates the issue.
Rollup merge of rust-lang#136951 - compiler-errors:clause-binder, r=lqd Use the right binder for rebinding `PolyTraitRef` Fixes rust-lang#136940 I committed a slightly different test which still demonstrates the issue.
rustc-ice-2025-02-12T19_02_34-223082.txt
Code
futures = "0.3.31"
Meta
rustc --version --verbose
:Error output
Backtrace
The text was updated successfully, but these errors were encountered: