-
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 for broken MIR in 1.57.0, beta and nightly #91633
Comments
Minimized a bit more: use std::ops::Index;
pub struct Handle(u64);
impl<T> Index<Handle> for [T] where Self: Index<usize> {
type Output = <Self as Index<usize>>::Output;
fn index(&self, index: Handle) -> &Self::Output {
&self[index.0 as usize]
}
} |
It started ICE-ing in 1.41.0:
|
This compiles successfully without the It also compiles if you change the bound to constrain the |
I bisected it to be between 9e34664 and ac162c6:
I've tried to bisect between these commits, but I'm getting a compilation error in llvm. |
It'll be #65879, which changed the coherence rules to allow The impl in this code is intentionally allowed under the new rules and should be fine, so it didn't really regress in that PR so much as it was newly permitted but likely surfaced a pre-existing bug. I tried to replicate this issue with a local trait but this compiles successfully, so this does seem to involve the built-in |
Further reduced to: fn f<T> (it: &[T])
where
[T] : std::ops::Index<usize>,
{
let _ = &it[0];
}
I agree with @SNCPlay42's assessment:
|
So it could be considered a stable-to-stable regression? I don't how or who could add this label. |
Yeah, I guess we could @rustbot modify labels +regression-from-stable-to-stable although it's a regression from a very old stable 😄 |
Assigning priority as discussed in the Zulip thread of the Prioritization Working Group. @rustbot label -I-prioritize +P-medium |
Code
https://play.rust-lang.org/?version=stable&mode=debug&edition=2021&gist=8289d2eaf690a945df598352845ea173
Meta
Error output
Backtrace
The text was updated successfully, but these errors were encountered: