-
Notifications
You must be signed in to change notification settings - Fork 12.8k
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
Rollup of 10 pull requests #33900
Merged
Merged
Rollup of 10 pull requests #33900
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This matches the other subsections.
The new order puts all the "when" questions together and puts the "how" question with the "derivable" section. So you have to scroll past (and hopefully read) the can/cannot/should caveats and guidelines to get to the information about how to actually go about doing it once you've determined that you can and should, with derivable information first so that you can just use the derived implementation if that applies. Previous order: * General explanation * When can my type be `Copy`? * How can I implement `Copy`? * When can my type _not_ be `Copy`? * When should my type be `Copy`? * Derivable New order: * General explanation * When can my type be `Copy`? * When can my type _not_ be `Copy`? * When should my type be `Copy`? * Derivable * How can I implement `Copy`?
Including an example of a custom implementation. I put this expanded section after the `Derivable` section to encourage use of that first.
Building on the example in PartialEq.
A bit of duplication from the module documentation, but simplified to be closer to being trivially copy-paste-able.
Similar to the `Ord` examples but calling out that it can be defined using `cmp` from `Ord` or using `partial_cmp` in a situation that demands that.
Add explicit "Derivable" and "How can I implement `Default`" sections. Copied relevant sections from the module-level documentation, but also linked to there-- it has a more comprehensive narrative with examples that show implementation AND use. Decided to just put implementation example in the trait documentation.
I had already copied the implementation example in a previous commit; this copies the explanation and usage examples to the general trait description.
By accident, I found the `make tips` target, which helped me to gain more insight on how to work with the system more quickly.
Fix `asm-misplaced-option` on ARM/AArch64 This fixes rust-lang#33737. Of course, since we don't run `make check` for ARM cross builds, you probably won't notice it.
…larifications, r=steveklabnik Trait documentation clarifications Hi! I've felt a bit of friction lately in figuring out how to write custom implementations of the `derive`able traits, so I decided to add to the docs :) The docs for `Copy` are already excellent-- clear, useful sections that I only reordered a bit-- they're now: * General explanation * When can my type be `Copy`? * When can my type _not_ be `Copy`? * When should my type be `Copy`? * Derivable * How can I implement `Copy`? I didn't add all these sections for all the traits, but I did make sure all the derivable traits had a consistent "Derivable" section that explained what the derived implementation does and a "How can I implement" section that has an example. Please check me for correctness-- I tried to do research to make sure I was saying accurate things but I'm still learning! ❤️ I'd also love suggestions on information to add that is still missing-- I think these traits are important and deserve to have awesome docs!
…veklabnik Fix invalid background color in stability elements r? @steveklabnik
Point out the clone operation in summary line docs of `Vec::extend_from_slice`
…rner Improve E0084 error explanation r? @Manishearth cc @steveklabnik
…ndturner Add new error code tests r? @steveklabnik
Fix ICE on parsing a bad metavariable in a macro definition Fixes rust-lang#33569, fixes rust-lang#33728. r? @pnkfelix
Add `make tips` as useful make target By accident, I found the `make tips` target, which helped me to gain more insight on how to work with the system more quickly.
Make Ipv4Addr cmp() faster Closes rust-lang#33885
…ishearth rustfmt on liblog
@bors r+ p=1 |
📌 Commit 2c4fd94 has been approved by |
(rust_highfive has picked a reviewer for you, use r? to override) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
asm-misplaced-option
on ARM/AArch64 #33753, Trait documentation clarifications #33815, Fix invalid background color in stability elements #33829, Point out the clone operation in summary line docs ofVec::extend_from_slice
#33858, Improve E0084 error explanation #33865, Add new error code tests #33866, Fix ICE on parsing a bad metavariable in a macro definition #33870, Addmake tips
as useful make target #33874, Make Ipv4Addr cmp() faster #33891, rustfmt on liblog #33898