-
Notifications
You must be signed in to change notification settings - Fork 13.4k
type parameter V/#2
(V/2) out of range when substituting with MIR inlining enabled
#78529
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Comments
Inlining now uses pub struct D<A, B> {
a: *mut Option<A>,
b: *mut Vec<B>,
}
impl<A, B> Drop for D<A, B> {
fn drop(&mut self) {
unsafe {
std::ptr::drop_in_place(self.a);
std::ptr::drop_in_place(self.b);
}
}
} $ rustc --crate-type=lib -Zmir-opt-level=2 a.rs
error: internal compiler error: compiler/rustc_middle/src/ty/subst.rs:528:17: type parameter `B/#1` (B/1) out of range when substituting, substs=[std::vec::Vec<B>]
...
query stack during panic:
#0 [optimized_mir] optimizing MIR for `<D<A, B> as std::ops::Drop>::drop` |
Not sure whether the following is a duplicate to this bug. If not I will file another one. trait CollectionFamily {
type Member<T>;
}
fn floatify() {
Family as CollectionFamily
}
NOTE: The bug is found by our work-in-progress compiler testing tool Kira, and the test program is reduced/minimized by Perses |
@chengniansun that would be a different issue. |
… r=oli-obk inliner: Use substs_for_mir_body Changes from 68965 extended the kind of instances that are being inlined. For some of those, the `instance_mir` returns a MIR body that is already expressed in terms of the types found in substitution array, and doesn't need further substitution. Use `substs_for_mir_body` to take that into account. Resolves rust-lang#78529. Resolves rust-lang#78560.
… r=oli-obk inliner: Use substs_for_mir_body Changes from 68965 extended the kind of instances that are being inlined. For some of those, the `instance_mir` returns a MIR body that is already expressed in terms of the types found in substitution array, and doesn't need further substitution. Use `substs_for_mir_body` to take that into account. Resolves rust-lang#78529. Resolves rust-lang#78560.
… r=oli-obk inliner: Use substs_for_mir_body Changes from 68965 extended the kind of instances that are being inlined. For some of those, the `instance_mir` returns a MIR body that is already expressed in terms of the types found in substitution array, and doesn't need further substitution. Use `substs_for_mir_body` to take that into account. Resolves rust-lang#78529. Resolves rust-lang#78560.
env RUSTFLAGS=-Zmir-opt-level=2 cargo check -Zbuild-std --target x86_64-unknown-linux-gnu
Error output
Regressed in #68965, cc @eddyb.
The text was updated successfully, but these errors were encountered: