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_tyis a function for derefencing a type which overloads theDereftrait. But actually this function never uses the parameter pushed in until this PR. -_-