-
Notifications
You must be signed in to change notification settings - Fork 12.9k
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 13 pull requests #82186
Closed
Closed
Rollup of 13 pull requests #82186
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 commit fixes the file names of the `flat_map_identity` test. Previously, their names were started with `unnecessary_flat_map` even though the lint rule name is `flat_map_identity`. This inconsistency happened probably because the rule name was changed during the discussion in the PR where this rule was introduced. ref: rust-lang/rust-clippy#4231
Fix file names of flat_map_identity test This patch fixes the file names of the `flat_map_identity` test. Previously, their names were started with `unnecessary_flat_map` even though the lint rule name is `flat_map_identity`. This inconsistency happened probably because the rule name was changed during the discussion in the PR where this rule was introduced. ref: rust-lang/rust-clippy#4231 changelog: none
…sults, r=flip1995 New Lint: Manual Flatten This is a draft PR for [Issue 6564](rust-lang/rust-clippy#6564). r? `@camsteffen` - \[x] Followed [lint naming conventions][lint_naming] - \[x] Added passing UI tests (including committed `.stderr` file) - \[x] `cargo test` passes locally - \[x] Executed `cargo dev update_lints` - \[x] Added lint documentation - \[x] Run `cargo dev fmt` --- *Please write a short comment explaining your change (or "none" for internal only changes)* changelog: Add new lint [`manual_flatten`] to check for loops over a single `if let` expression with `Result` or `Option`.
In other words, support: `disallowed_methods = ["alloc::vec::Vec::new"]` (a free function) in addition to `disallowed_methods = ["alloc::vec::Vec::leak"]` (a method). Improve the documentation to clarify that users must specify the full qualified path for each disallowed function, which can be confusing for reexports. Include an example `clippy.toml`. Simplify the actual lint pass so we can reuse `utils::fn_def_id`.
This will convert the path to the Rust repo to an absolute path. This is important for the clippy_lints/Cargo.toml file. Otherwise if a relative path is passed, rst-analyzer won't find the Rust repo, because it starts the relative path search from the clippy_lints dir, not the rust-clippy dir where the ra_setup command was run from.
Fix typo This patch fixes a typo. changelog: none
Use absolute path to Rust repo in ra_setup This will convert the path to the Rust repo to an absolute path. This is important for the clippy_lints/Cargo.toml file. Otherwise if a relative path is passed, rst-analyzer won't find the Rust repo, because it starts the relative path search from the clippy_lints dir, not the rust-clippy dir where the ra_setup command was run from. changelog: none
This fixes false positives and false negatives.
… inside the rustc repo. Do not check if clippy version matches rustc version when runnning tests inside the rustc repo. This makes sure that upstream rustc maintainers do not have to deal with our test failing/mismatching versions when the rustc version bump is happening. cc rust-lang#6683
Fix SourceMap::start_point `start_point` needs to return the *first* character's span, but it would previously call `find_width_of_character_at_span` which returns the span of the *last* character. The implementation is now fixed. Other changes: - Docs for start_point, end_point, find_width_of_character_at_span updated - Minor simplification in find_width_of_character_at_span code Fixes rust-lang#81800
Simplify pattern grammar, improve or-pattern diagnostics This implements the change under FCP in rust-lang#81415. It allows nested or-patterns to contain a leading `|`, simplifying the [grammar for patterns](https://github.com/rust-lang/reference/pull/957/files?short_path=cc629f1#diff-cc629f15712821139bc706c63b3845ab59a008e2a998e08ffad42e3aebcbcbe2). Along the way, we also improve the diagnostics around a few specially-handled cases, such as using `||` instead of `|`, using or-patterns in fn params, including the leading `|` in the pattern span, etc. r? `@petrochenkov`
…chenkov Move some tests to more reasonable directories - 4 cc rust-lang#73494 r? `@petrochenkov` - [issues/issue-4201.rs](https://github.com/rust-lang/rust/blob/master/src/test/ui/issues/issue-4201.rs) <sup>[issue](https://github.com/rust-lang/rust/issues/4201)</sup>: expr 1.000 - [old-suffixes-are-really-forbidden.rs](https://github.com/rust-lang/rust/blob/master/src/test/ui/old-suffixes-are-really-forbidden.rs) <sup>unknown</sup>: parser 1.031 - [typeclasses-eq-example-static.rs](https://github.com/rust-lang/rust/blob/master/src/test/ui/typeclasses-eq-example-static.rs) <sup>unknown</sup>: binding 1.033 - [issues/issue-33537.rs](https://github.com/rust-lang/rust/blob/master/src/test/ui/issues/issue-33537.rs) <sup>[issue](https://github.com/rust-lang/rust/issues/33537)</sup>: consts 1.036 - [issues/issue-31924-non-snake-ffi.rs](https://github.com/rust-lang/rust/blob/master/src/test/ui/issues/issue-31924-non-snake-ffi.rs) <sup>[issue](https://github.com/rust-lang/rust/issues/31924)</sup>: lint 1.046 - [issues/issue-44406.rs](https://github.com/rust-lang/rust/blob/master/src/test/ui/issues/issue-44406.rs) <sup>[issue](https://github.com/rust-lang/rust/issues/44406)</sup>: parser 1.051 - [type-id-higher-rank.rs](https://github.com/rust-lang/rust/blob/master/src/test/ui/type-id-higher-rank.rs) <sup>unknown</sup>: unboxed-closures 1.074 - [issues/issue-20616-3.rs](https://github.com/rust-lang/rust/blob/master/src/test/ui/issues/issue-20616-3.rs) <sup>[issue](https://github.com/rust-lang/rust/issues/20616)</sup>: parser 1.077 - [html-literals.rs](https://github.com/rust-lang/rust/blob/master/src/test/ui/html-literals.rs) <sup>unknown</sup>: macros 1.083 - [issues/issue-13837.rs](https://github.com/rust-lang/rust/blob/master/src/test/ui/issues/issue-13837.rs) <sup>[issue](https://github.com/rust-lang/rust/issues/13837)</sup>: consts 1.089 - [issues/issue-21726.rs](https://github.com/rust-lang/rust/blob/master/src/test/ui/issues/issue-21726.rs) <sup>[issue](https://github.com/rust-lang/rust/issues/21726)</sup>: associated-types 1.095 - [one-tuple.rs](https://github.com/rust-lang/rust/blob/master/src/test/ui/one-tuple.rs) <sup>unknown</sup>: binding 1.107 - [issues/issue-43784-associated-type.rs](https://github.com/rust-lang/rust/blob/master/src/test/ui/issues/issue-43784-associated-type.rs) <sup>[issue](https://github.com/rust-lang/rust/issues/43784)</sup>: associated-types 1.108 - [project-defer-unification.rs](https://github.com/rust-lang/rust/blob/master/src/test/ui/project-defer-unification.rs) <sup>unknown</sup>: associated-types 1.109 - [struct-literal-variant-in-if.rs](https://github.com/rust-lang/rust/blob/master/src/test/ui/struct-literal-variant-in-if.rs) <sup>unknown</sup>: parser 1.110 - [rvalue-static-promotion.rs](https://github.com/rust-lang/rust/blob/master/src/test/ui/rvalue-static-promotion.rs) <sup>unknown</sup>: consts 1.114 - [nullable-pointer-ffi-compat.rs](https://github.com/rust-lang/rust/blob/master/src/test/ui/nullable-pointer-ffi-compat.rs) <sup>unknown</sup>: regions 1.129 - [range_inclusive_gate.rs](https://github.com/rust-lang/rust/blob/master/src/test/ui/range_inclusive_gate.rs) <sup>unknown</sup>: for-loop-while 1.174 - [simd-type-generic-monomorphisation.rs](https://github.com/rust-lang/rust/blob/master/src/test/ui/simd-type-generic-monomorphisation.rs) <sup>unknown</sup>: simd 1.175 - [issues/issue-77993-2.rs](https://github.com/rust-lang/rust/blob/master/src/test/ui/issues/issue-77993-2.rs) <sup>[issue](https://github.com/rust-lang/rust/issues/77993)</sup>: async-await 1.183 - [issues/issue-23595-2.rs](https://github.com/rust-lang/rust/blob/master/src/test/ui/issues/issue-23595-2.rs) <sup>[issue](https://github.com/rust-lang/rust/issues/23595)</sup>: associated-types 1.194 - [issues/issue-40847.rs](https://github.com/rust-lang/rust/blob/master/src/test/ui/issues/issue-40847.rs) <sup>[issue](https://github.com/rust-lang/rust/issues/40847)</sup>: macros 1.194 - [issues/issue-6157.rs](https://github.com/rust-lang/rust/blob/master/src/test/ui/issues/issue-6157.rs) <sup>[issue](https://github.com/rust-lang/rust/issues/6157)</sup>: regions 1.195 - [issues/issue-32829.rs](https://github.com/rust-lang/rust/blob/master/src/test/ui/issues/issue-32829.rs) <sup>[issue](https://github.com/rust-lang/rust/issues/32829)</sup>: consts 1.241 - [type-sizes.rs](https://github.com/rust-lang/rust/blob/master/src/test/ui/type-sizes.rs) <sup>unknown</sup>: structs-enums 1.281 - [issues/issue-24204.rs](https://github.com/rust-lang/rust/blob/master/src/test/ui/issues/issue-24204.rs) <sup>[issue](https://github.com/rust-lang/rust/issues/24204)</sup>: associated-types 1.305 - [issues/issue-22560.rs](https://github.com/rust-lang/rust/blob/master/src/test/ui/issues/issue-22560.rs) <sup>[issue](https://github.com/rust-lang/rust/issues/22560)</sup>: associated-types 1.354 - [emit-artifact-notifications.rs](https://github.com/rust-lang/rust/blob/master/src/test/ui/emit-artifact-notifications.rs) <sup>unknown</sup>: rmeta 1.368 - [repeat_count_const_in_async_fn.rs](https://github.com/rust-lang/rust/blob/master/src/test/ui/repeat_count_const_in_async_fn.rs) <sup>unknown</sup>: async-await 1.370 - [expr-if-panic.rs](https://github.com/rust-lang/rust/blob/master/src/test/ui/expr-if-panic.rs) <sup>unknown</sup>: expr 1.371 - [cleanup-rvalue-during-if-and-while.rs](https://github.com/rust-lang/rust/blob/master/src/test/ui/cleanup-rvalue-during-if-and-while.rs) <sup>unknown</sup>: for-loop-while 1.378 - [write-to-static-mut-in-static.rs](https://github.com/rust-lang/rust/blob/master/src/test/ui/write-to-static-mut-in-static.rs) <sup>unknown</sup>: consts 1.381 - [issues/issue-17718-references.rs](https://github.com/rust-lang/rust/blob/master/src/test/ui/issues/issue-17718-references.rs) <sup>[issue](https://github.com/rust-lang/rust/issues/17718)</sup>: consts 1.404 - [dotdotdot-expr.rs](https://github.com/rust-lang/rust/blob/master/src/test/ui/dotdotdot-expr.rs) <sup>unknown</sup>: parser 1.784 - [regions-fn-subtyping-return-static-fail.rs](https://github.com/rust-lang/rust/blob/master/src/test/ui/regions-fn-subtyping-return-static-fail.rs) <sup>unknown</sup>: regions 1.959
Update Clippy Biweekly Clippy update r? ``@Manishearth``
Implement reborrow for closure captures The strategy for captures is detailed here with examples: https://hackmd.io/PzxYMPY4RF-B9iH9uj9GTA Key points: - We only need to reborrow a capture in case of move closures. - If we mutate something via a `&mut` we store it as a `MutBorrow`/`UniqueMuBorrow` of the path containing the `&mut`, - Similarly, if it's read via `&` ref we just store it as a `ImmBorrow` of the path containing the `&` ref. - If a path doesn't deref a `&mut`, `&`, then that path is captured by Move. - If the use of a path results in a move when the closure is called, then that path is truncated before any deref and the truncated path is moved into the closure. - In the case of non-move closure if a use of a path results in a move, then the path is truncated before any deref and the truncated path is moved into the closure. Note that the implementation differs a bit from the document to allow for truncated path to be used in the ClosureKind analysis that happens as part of the first capture analysis pass. Closes: rust-lang/project-rfc-2229#31 r? `@nikomatsakis`
…h726 Ensure valid TraitRefs are created for GATs This fixes `ProjectionTy::trait_ref` to use the correct substs. Places that need all of the substs have been updated to not use `trait_ref`. r? `@jackh726`
To digit simplification I found out the other day that all the ascii digits have the first four bits as one would hope them to. (Eg. char `2` ends `0b0010`). There are two bits to indicate it's in the digit range ( `0b0011_0000`). If it is a true digit then all the higher bits aside from these two will be 0 (as ascii is the lowest part of the unicode u32 spectrum). So XORing with `0b11_0000` should mean we either get the number 0-9 or alternativly we get a larger number in the u32 space. If we get something that's not 0-9 then it will be discarded as it will be greater than the radix. The code seems so fast though that there's quite a lot of noise in the benchmarks so it's not that easy to prove conclusively that it's faster as well as less instructions. The non-fast path I was toying with as well wondering if we could do this as then we'd only have one return and less instructions still: ``` match self { 'a'..='z' => self as u32 - 'a' as u32 + 10, 'A'..='Z' => self as u32 - 'A' as u32 + 10, _ => { radix = 10; self as u32 ^ ASCII_DIGIT_MASK}, } ``` Here's the [godbolt](https://godbolt.org/z/883c9n). ( H/T to `@byteshadow` for pointing out xor was what I needed)
Deprecate `intrinsics::drop_in_place` and `collections::Bound`, which accidentally weren't deprecated Fixes rust-lang#82080. I've taken the liberty of updating the `since` values to 1.52, since an unobservable deprecation isn't much of a deprecation (even the detailed release notes never bothered to mention these deprecations). As mentioned in the issue I'm *pretty* sure that using a type alias for `Bound` is semantically equivalent to the re-export; [the reference implies](https://doc.rust-lang.org/reference/items/type-aliases.html) that type aliases only observably differ from types when used on unit structs or tuple structs, whereas `Bound` is an enum.
ES5 checks rustdoc is supposed to run on IE11 but someone reported me that it wasn't. I just confirmed it by using `es-check` with the `es5` option like this: ``` $ es-check es5 src/librustdoc/html/static/*.js ``` The PR fixes those issues and add CI checks to prevent regressions. ``@Mark-Simulacrum:`` I added checks in the CI, but not sure if it's the correct way to do it. Any help on that side would be very appreciated! r? ``@Nemo157``
Fix typo in rustc_infer::infer::UndoLog Also use double quotes.
…545, r=GuillaumeGomez Add long explanation for E0545 Helps with rust-lang#61137
avoid full-slicing slices If we already have a slice, there is no need to get another full-range slice from that, just use the original. clippy::redundant_slicing
validation: fix invalid-fn-ptr error message rust-lang#82061 changed the code here to print an `ImmTy` instead of a `ScalarMaybeUninit`; that was an accident. So go back to printing a `ScalarMaybeUninit`. r? ``@oli-obk``
@bors r+ rollup=never p=5 |
📌 Commit ae8090b 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 16, 2021
⌛ Testing commit ae8090b with merge 9ac30bbd40aa2aed4be6de32367ae67cd605f520... |
The job Click to see the possible cause of the failure (guessed by this bot)
|
💔 Test failed - checks-actions |
bors
added
S-waiting-on-review
Status: Awaiting review from the assignee but also interested parties.
and removed
S-waiting-on-bors
Status: Waiting on bors to run and complete tests. Bors will change the label on completion.
labels
Feb 16, 2021
☔ The latest upstream changes (presumably #82192) made this pull request unmergeable. Please resolve the merge conflicts. |
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-review
Status: Awaiting review from the assignee but also interested parties.
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:
intrinsics::drop_in_place
andcollections::Bound
, which accidentally weren't deprecated #82122 (Deprecateintrinsics::drop_in_place
andcollections::Bound
, which accidentally weren't deprecated)Failed merges:
r? @ghost
@rustbot modify labels: rollup
Create a similar rollup