-
Notifications
You must be signed in to change notification settings - Fork 12.9k
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
Indexing regression in beta #48715
Comments
cc @regexident |
I too remember something like this. I think it was a bug fix. Let me see if I can find it. |
Maybe same problem as reported here: #47349 |
Okay, we should investigate. I'm going to nominate and set to P-high for compiler team eyes, if it's the same reason as #47349 then let's just close -- I don't think we need to do much more than that if it's a bugfix. |
The regression is caused by #47167 according to bisection, as expected. Test program: #![crate_type = "rlib"]
struct Cursor;
struct AlignmentMatrix(Vec<u8>);
impl AlignmentMatrix {
fn offset(&self, _: &Cursor) -> usize {
0
}
fn mut_slice(&mut self) -> &mut [u8] {
&mut self.0
}
pub fn set_at(&mut self, cursor: &Cursor) {
self.mut_slice()[self.offset(cursor)] = 0;
}
} Test script: #!/bin/sh
$RUSTC_RELATIVE -V
! $RUSTC_RELATIVE 1.rs Result:
|
So, what did I win? 😅 (Joking aside, any way I can be of help here?) |
@regexident You could split that into two statements: let offset = self.offset(cursor);
self.mut_slice()[offset] = byte; |
Since this is due to a confirmed bug fix, I'm going to close the issue then. @regexident please let us know though if we can help in any other way! |
seal-0.1.0 regressed with the following:
This looks vaguely familiar but looking at pull requests didn't seem to find anything apparent.
cc @rust-lang/compiler
The text was updated successfully, but these errors were encountered: