-
Notifications
You must be signed in to change notification settings - Fork 13k
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 19 pull requests #31147
Closed
Closed
Rollup of 19 pull requests #31147
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
Documentation of `CStr::from_ptr` suggests using `str::from_utf8(slice.to_bytes()).unwrap()` to obtain a `&str` but `CStr` has `CStr::to_str` that does exactly that.
Introduced in PR rust-lang#30724, needs to mention that type parameter defaults are legal in trait and type definitions too.
Responding to [a thread of discussion on the Rust subreddit](https://www.reddit.com/r/rust/comments/3racik/mutable_lifetimes_are_too_long_when_matching_an/), it was identified that the presence of the Entry API is not duly publicised. This commit aims to add some reasonable examples of common usages of this API to the main example secion of the `HashMap` documentation. This is part of issue rust-lang#29348.
E0210 explains about orphan rules and suggests using a local type as a workaround. It wasn't obvious to me that I couldn't use a type alias, so I added a note.
Also change the examples to make this more obvious. Fixes rust-lang#31129.
Updated documentation to clarify the difference between `and_then` and `map`. This also explains why we need `and_then` in addition to `map`. Please look at the diff for more information. r? @alexcrichton
Fix type parameter default error to mention type and trait definitions Introduced in PR rust-lang#30724, needs to mention that type parameter defaults are legal in trait and type definitions too.
Documentation of `CStr::from_ptr` suggests using `str::from_utf8(slice.to_bytes()).unwrap()` to obtain a `&str` but `CStr` has `CStr::to_str` that does exactly that. (First PR, be nice :)
This was fixed in passing. Adding a regression test.
…ntry-api, r=steveklabnik Responding to [a thread of discussion on the Rust subreddit](https://www.reddit.com/r/rust/comments/3racik/mutable_lifetimes_are_too_long_when_matching_an/), it was identified that the presence of the Entry API is not duly publicised. This commit aims to add some reasonable examples of common usages of this API to the main example secion of the `HashMap` documentation. This is part of issue rust-lang#29348.
…veklabnik I tried to add an inline `span_suggestion()` to the error as well, but since generics don't have their own span it becomes too fragile/complicated to work. r? @steveklabnik fixes rust-lang#19477
I've been interested in the accessibility of Rustdoc's output, but never did anything about it. Today, I ran a tool, and it suggested adjusting some colors. Here's some screen shots. Before: ![2016-01-20-114944_443x199_scrot](https://cloud.githubusercontent.com/assets/27786/12455979/d84d7ae8-bf6b-11e5-9aea-0602fb1a8cfa.png) After: ![2016-01-20-114516_453x204_scrot](https://cloud.githubusercontent.com/assets/27786/12455841/36a55d14-bf6b-11e5-8014-239594c12e46.png) As you can see, the link text is just a _shade_ darker. Browsable: http://www.steveklabnik.com/rust-a11y-doc-testing/doc/std/
…y, r=steveklabnik
E0210 explains about orphan rules and suggests using a local type as a workaround. It wasn't obvious to me that I couldn't use a type alias, so I added a note.
Also change the examples to make this more obvious. Fixes rust-lang#31129.
r? @brson (rust_highfive has picked a reviewer for you, use r? to override) |
@bors: r+ p=1 |
📌 Commit deefde0 has been approved by |
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.
map
andand_then
with an example. #30971, Fix type parameter default error to mention type and trait definitions #30997, Improve CStr::from_ptr example in docs #31019, Add test for #30123 #31031, Add examples of the Entry API to the HashMap documentation. #31035, Improve E0317 long diagnostics #31045, Correct code in E0382 explanation #31050, tweak colors for a11y #31054, Add alt tags for logos #31055, Add Alexis thesis to bibliography #31061, doc: improve grammar #31088, doc: this sentence did not read well #31090, Fix typo in "Getting Started" section of the book #31111, update link to unwind in book #31113, book: Clarify that trait or type must be in same crate as impl #31128, E0210: Add a warning about type aliases #31130, Document that BTreeMap iteration is in order #31136, Fix the missing line in the guessing-game.md #31145, Semaphore not sempahore #31146