-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
FP deref_addrof
#12319
Comments
From what I've seen, I was able to confirm the same thing happens using a variable fn main() {
let _ = false && return; // raise error
let x = false;
let _ = x && return; // do not raise error
let _ = *&mut false && return; // do not raise error
} So I suppose that those checks are not done on variables and that the |
I can confirm Alexis' theory. Here's the HIR for that
I'll do some bugfixing. |
Uff, work is pilling up and what I thought would be a very easy +1 line diff has become a bit more complex than anticipated. I'll let a contributor handle it :D |
Also relevant, previous discussion of ndarray applications of *&mut: https://internals.rust-lang.org/t/assign-ops-papercut-with-custom-view-types/ |
Summary
.
Lint Name
deref_addrof
Reproducer
I tried this code:
I saw this happen:
I expected to see this happen:
it no compily
Version
Additional Labels
No response
The text was updated successfully, but these errors were encountered: