Skip to content

Conversation

sfackler
Copy link
Member

This will enable rustdoc to treat them specially.

I also got rid of std::cmp::cmp2, which is isomorphic to the TotalOrd impl for 2-tuples and never used.

It isn't used anywhere and `cmp2(a, b, c, d)` is identical to
`(a, b).cmp(&(c, d))`.
This will enable rustdoc to treat them specially.
@huonw
Copy link
Contributor

huonw commented Mar 16, 2014

I feel like "automatically" might be the wrong word, since the derivation doesn't happen automatically. Maybe just #[derived_impl] or something? (I know the original doc comment has automatically too, but I was wrong to use that word when I created it.)

bors added a commit that referenced this pull request Mar 16, 2014
This will enable rustdoc to treat them specially.

I also got rid of `std::cmp::cmp2`, which is isomorphic to the `TotalOrd` impl for 2-tuples and never used.
@bors bors closed this Mar 16, 2014
@bors bors merged commit 05c7323 into rust-lang:master Mar 16, 2014
@sfackler sfackler deleted the automatically-derived branch May 15, 2014 05:02
flip1995 pushed a commit to flip1995/rust that referenced this pull request Jun 27, 2024
…xendoo

Avoid emitting `assigning_clones` when cloned data borrows from the place to clone into

Fixes rust-lang#12444
Fixes rust-lang#12460
Fixes rust-lang#12749
Fixes rust-lang#12757
Fixes rust-lang#12929

I think the documentation for the function should describe what- and how this is fixing the issues well.
It avoids emitting a warning when the data being cloned borrows from the place to clone into, which is information that we can get from `PossibleBorrowerMap`. Unfortunately, it is a tiny bit tedious to match on the MIR like that and I'm not sure if this is possibly relying a bit too much on the exact MIR lowering for assignments.

Things left to do:
- [x] Handle place projections (or verify that they work as expected)
- [x] Handle non-`Drop` types

changelog: [`assigning_clones`]: avoid warning when the suggestion would lead to a borrow-check error
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants