-
Notifications
You must be signed in to change notification settings - Fork 13.2k
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
Fix wrong argument in autoderef process #71627
Conversation
(rust_highfive has picked a reviewer for you, use r? to override) |
@bors r+ rollup |
📌 Commit 8d2f301 has been approved by |
Fix wrong argument in autoderef process The `overloaded_deref_ty` is a function for derefencing a type which overloads the `Deref` trait. But actually this function never uses the parameter pushed in until this PR. -_-
Rollup of 6 pull requests Successful merges: - rust-lang#71507 (Document unsafety in core::ptr) - rust-lang#71572 (test iterator chain type length blowup) - rust-lang#71617 (Suggest `into` instead of `try_into` if possible with int types) - rust-lang#71627 (Fix wrong argument in autoderef process) - rust-lang#71678 (Add an index page for nightly rustc docs.) - rust-lang#71680 (Fix doc link to Eq trait from PartialEq trait) Failed merges: - rust-lang#71597 (Rename Unique::empty() -> Unique::dangling()) r? @ghost
Does this change behavior in any way? Is there a test case we could add to ensure it does not regress? |
@RalfJung I'm pretty sure this won't cause a regress. This just correct the function to do the thing it meant to do. Is this related to some bug? I can help reviewing. |
Sorry, what I meant is -- this fixes a bug, right? If so, there should be a test to make sure that in the future, this does not get changed back to the old, wrong behavior that we had before your PR. |
@RalfJung This doesn't fix a bug directly. This actually fixes future bugs. The situation is like this:
Here we get correct answer 3. But in the future when we calls And this function is an internal function and only called in one place so for a long time this bug is left undiscovered. I think for regression avoiding, a unit test is needed, but unit tests seem to be not exist in current compiler. :-( |
The
overloaded_deref_ty
is a function for derefencing a type which overloads theDeref
trait. But actually this function never uses the parameter pushed in until this PR. -_-