-
Notifications
You must be signed in to change notification settings - Fork 12.7k
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: broken MIR in DefId: index of non-array #118111
Comments
Regression in nightly-2023-04-20 commit[0] 2023-04-18: Auto merge of #109772 - petrochenkov:slimchild, r=cjgillot |
Oh this might be #110432 contained in the first rollup ping @compiler-errors reduced a bit: use core::ops::Index;
struct Map<T, F> {
f: F,
inner: T,
}
impl<T, F, Idx> Index<Idx> for Map<T, F>
where
T: Index<Idx>,
F: Fn(&T, Idx) -> Idx,
{
type Output = T::Output;
fn index(&self, index: Idx) -> &Self::Output {
self.inner.index(index)
}
}
fn main() {
Map {
inner: [0_usize],
f: |_, i: usize| 1_usize,
}[0];
} |
WG-prioritization assigning priority (Zulip discussion). @rustbot label -I-prioritize +P-medium |
…e, r=aliemjay Don't ICE when ambiguity is found when selecting `Index` implementation in typeck Fixes rust-lang#118111 The problem here is when we're manually "selecting" an impl for `base_ty: Index<?0>`, we don't consider placeholder region errors (leak check) or ambiguous predicates. Those can lead to us not actually emitting any fulfillment errors on line 3131.
…e, r=aliemjay Don't ICE when ambiguity is found when selecting `Index` implementation in typeck Fixes rust-lang#118111 The problem here is when we're manually "selecting" an impl for `base_ty: Index<?0>`, we don't consider placeholder region errors (leak check) or ambiguous predicates. Those can lead to us not actually emitting any fulfillment errors on line 3131.
Rollup merge of rust-lang#118112 - compiler-errors:index-ambiguity-ice, r=aliemjay Don't ICE when ambiguity is found when selecting `Index` implementation in typeck Fixes rust-lang#118111 The problem here is when we're manually "selecting" an impl for `base_ty: Index<?0>`, we don't consider placeholder region errors (leak check) or ambiguous predicates. Those can lead to us not actually emitting any fulfillment errors on line 3131.
Code
Meta
rustc --version --verbose
:Error output
Backtrace
The text was updated successfully, but these errors were encountered: