-
Notifications
You must be signed in to change notification settings - Fork 12.7k
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 11 pull requests #82426
Closed
Closed
Rollup of 11 pull requests #82426
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
Currently, when a user uses a struct pattern to pattern match on a tuple struct, the errors we emit generally suggest adding fields using their field names, which are numbers. However, numbers are not valid identifiers, so the suggestions, which use the shorthand notation, are not valid syntax. This commit changes those errors to suggest using the actual tuple struct pattern syntax instead, which is a more actionable suggestion.
Apparently `"foo\""` has different behavior from `'foo\''` in Python shlex. See the [discussion on Zulip][z] for more. [z]: https://rust-lang.zulipchat.com/#narrow/stream/266220-rustdoc/topic/.40has.20checks.20.22no.20closing.20quotation.22
Following rust-lang#78026, `std::fs::hard_link` on most platforms does not follow symlinks. Change the WASI implementation to also not follow symlinks.
Add diagnostic items to the following types: OsString (os_string_type) PathBuf (path_buf_type) Owned (to_owned_trait) As well as the to_vec method on slice/[T]
Some newcomers are confused by the behavior of tail expressions, interpreting that "leaving out the `;` makes it the return value". To help them go in the right direction, suggest using `return` instead when applicable.
When a tail expression isn't unit, we previously always suggested adding a trailing `;` to turn it into a statement. This suggestion isn't appropriate for any expression that doesn't have side-effects, as the user will have likely wanted to call something else or do something with the resulting value, instead of just discarding it.
Enable smart punctuation Closes rust-lang#76690.
… r=KodrAus Improve design of `assert_len` It was discussed in the [tracking issue](rust-lang#76393 (comment)) that `assert_len`'s name and usage are confusing. This PR improves them based on a suggestion by `@scottmcm` in that issue. I also improved the documentation to make it clearer when you might want to use this method. Old example: ```rust let range = range.assert_len(slice.len()); ``` New example: ```rust let range = range.ensure_subset_of(..slice.len()); ``` Fixes rust-lang#81157
Improve suggestion for tuple struct pattern matching errors. Closes rust-lang#80174 This change allows numbers to be parsed as field names when pattern matching on structs, which allows us to provide better error messages when tuple structs are matched using a struct pattern. r? `@estebank`
…urn, r=lcnr Suggest `return`ing tail expressions that match return type Some newcomers are confused by the behavior of tail expressions, interpreting that "leaving out the `;` makes it the return value". To help them go in the right direction, suggest using `return` instead when applicable.
Slight perf improvement on char::to_ascii_lowercase `char::to_ascii_lowercase()` was checking if it was ascii and then if it was in the right range. Instead propose to check once (I think removing a compare and a shift in the process: [godbolt](https://godbolt.org/z/e5Tora) ). before: ``` test char::methods::bench_to_ascii_lowercase ... bench: 11,196 ns/iter (+/- 632) test char::methods::bench_to_ascii_uppercase ... bench: 11,656 ns/iter (+/- 671) ``` after: ``` test char::methods::bench_to_ascii_lowercase ... bench: 9,612 ns/iter (+/- 979) test char::methods::bench_to_ascii_uppercase ... bench: 8,241 ns/iter (+/- 701) ``` (calling u8::to_ascii_lowercase and letting that flip the 5th bit is also an option, but it's more instructions. I'm thinking for things around ascii and char we want to be as efficient as possible.)
…imulacrum Avoid `cfg_if` in `std::os` rust-analyzer cannot currently load the `cfg_if` crate, which means that rust-analyzer is unable to see `std::os::{unix, windows, linux}` here. This works around that by avoiding `cfg_if`; the `#[cfg]` expressions are simple enough to reasonably write by hand. Fixes rust-lang/rust-analyzer#6038
Make WASI's `hard_link` behavior match other platforms. Following rust-lang#78026, `std::fs::hard_link` on most platforms does not follow symlinks. Change the WASI implementation to also not follow symlinks. r? ``@alexcrichton``
…n-here, r=estebank Do not consider using a semicolon inside of a different-crate macro Fixes rust-lang#81943
… r=RalfJung use PlaceRef abstractions more consistently Addresses this [comment](https://github.com/rust-lang/rust/pull/80865/files#r558978715) Associated issue: rust-lang#80647 r? ``@RalfJung``
… r=davidtwco add diagnostic items for OsString/PathBuf/Owned as well as to_vec on slice This is adding diagnostic items to be used by rust-lang/rust-clippy#6730, but my understanding is the clippy-side change does need to be done over there since I am adding a new clippy feature. Add diagnostic items to the following types: OsString (os_string_type) PathBuf (path_buf_type) Owned (to_owned_trait) As well as the to_vec method on slice/[T]
…n-esc, r=Nemo157 Remove query parameters when skipping search results Fixes rust-lang#81330. This PR changes the following: when pressing ESC and that no other "action" was performed (understand: no closing the search result, or hiding a menu or something along the line), then we discard the URL query parameters (the `?whatever=dsjfs`). What do you think about this change ``@rust-lang/rustdoc`` ? EDIT: finally we're simply removing the query parameter when we're skipping the search results. r? ``@Nemo157``
@bors r+ rollup=never p=5 |
📌 Commit aa9585e has been approved by |
bors
added
the
S-waiting-on-bors
Status: Waiting on bors to run and complete tests. Bors will change the label on completion.
label
Feb 23, 2021
The job Click to see the possible cause of the failure (guessed by this bot)
|
@bors r- --^ |
bors
added
S-waiting-on-author
Status: This is awaiting some action (such as code changes or more information) from the author.
and removed
S-waiting-on-bors
Status: Waiting on bors to run and complete tests. Bors will change the label on completion.
labels
Feb 23, 2021
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
rollup
A PR which is a rollup
S-waiting-on-author
Status: This is awaiting some action (such as code changes or more information) from the author.
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.
Successful merges:
assert_len
#81154 (Improve design ofassert_len
)return
ing tail expressions that match return type #81769 (Suggestreturn
ing tail expressions that match return type)cfg_if
instd::os
#81969 (Avoidcfg_if
instd::os
)hard_link
behavior match other platforms. #81984 (Make WASI'shard_link
behavior match other platforms.)Failed merges:
r? @ghost
@rustbot modify labels: rollup
Create a similar rollup