-
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
Make AssocOp Copy #73629
Merged
Merged
Make AssocOp Copy #73629
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
(rust_highfive has picked a reviewer for you, use r? to override) |
rust-highfive
added
the
S-waiting-on-review
Status: Awaiting review from the assignee but also interested parties.
label
Jun 22, 2020
@bors r+ rollup=always |
📌 Commit 2792014 has been approved by |
bors
added
S-waiting-on-bors
Status: Waiting on bors to run and complete tests. Bors will change the label on completion.
and removed
S-waiting-on-review
Status: Awaiting review from the assignee but also interested parties.
labels
Jun 26, 2020
bors
added a commit
to rust-lang-ci/rust
that referenced
this pull request
Jun 26, 2020
…arth Rollup of 13 pull requests Successful merges: - rust-lang#72620 (Omit DW_AT_linkage_name when it is the same as DW_AT_name) - rust-lang#72967 (Don't move cursor in search box when using arrows to navigate results) - rust-lang#73102 (proc_macro: Stop flattening groups with dummy spans) - rust-lang#73297 (Support configurable deny-warnings for all in-tree crates.) - rust-lang#73507 (Cleanup MinGW LLVM linkage workaround) - rust-lang#73588 (Fix handling of reserved registers for ARM inline asm) - rust-lang#73597 (Record span of `const` kw in GenericParamKind) - rust-lang#73629 (Make AssocOp Copy) - rust-lang#73681 (Update Chalk to 0.14) - rust-lang#73707 (Fix links in `SliceIndex` documentation) - rust-lang#73719 (emitter: column width defaults to 140) - rust-lang#73729 (disable collectionbenches for android) - rust-lang#73748 (Add code block to code in documentation of `List::rebase_onto`) Failed merges: r? @ghost
flip1995
pushed a commit
to flip1995/rust
that referenced
this pull request
Jul 14, 2020
…arth Rollup of 13 pull requests Successful merges: - rust-lang#72620 (Omit DW_AT_linkage_name when it is the same as DW_AT_name) - rust-lang#72967 (Don't move cursor in search box when using arrows to navigate results) - rust-lang#73102 (proc_macro: Stop flattening groups with dummy spans) - rust-lang#73297 (Support configurable deny-warnings for all in-tree crates.) - rust-lang#73507 (Cleanup MinGW LLVM linkage workaround) - rust-lang#73588 (Fix handling of reserved registers for ARM inline asm) - rust-lang#73597 (Record span of `const` kw in GenericParamKind) - rust-lang#73629 (Make AssocOp Copy) - rust-lang#73681 (Update Chalk to 0.14) - rust-lang#73707 (Fix links in `SliceIndex` documentation) - rust-lang#73719 (emitter: column width defaults to 140) - rust-lang#73729 (disable collectionbenches for android) - rust-lang#73748 (Add code block to code in documentation of `List::rebase_onto`) Failed merges: r? @ghost
bors
added a commit
to rust-lang/rust-clippy
that referenced
this pull request
Oct 10, 2020
Expands `manual_memcpy` to lint ones with loop counters Closes #1670 This PR expands `manual_memcpy` to lint ones with loop counters as described in #1670 (comment) Although the current code is working, I have a couple of questions and concerns. ~~Firstly, I manually implemented `Clone` for `Sugg` because `AssocOp` lacks `Clone`. As `AssocOp` only holds an enum, which is `Copy`, as a value, it seems `AssocOp` can be `Clone`; but, I was not sure where to ask it. Should I make a PR to `rustc`?~~ The [PR]( rust-lang/rust#73629) was made. Secondly, manual copying with loop counters are likely to trigger `needless_range_loop` and `explicit_counter_loop` along with `manual_memcpy`; in fact, I explicitly allowed them in the tests. Is there any way to disable these two lints when a code triggers `manual_memcpy`? And, another thing I'd like to note is that `Sugg` adds unnecessary parentheses when expressions with parentheses passed to its `hir` function, as seen here: ``` error: it looks like you're manually copying between slices --> $DIR/manual_memcpy.rs:145:14 | LL | for i in 3..(3 + src.len()) { | ^^^^^^^^^^^^^^^^^^ help: try replacing the loop by: `dst[3..((3 + src.len()))].clone_from_slice(&src[..((3 + src.len()) - 3)]) ``` However, using the `hir` function is needed to prevent the suggestion causing errors when users use bitwise operations; and also this have already existed, for example: `verbose_bit_mask`. Thus, I think this is fine. changelog: Expands `manual_memcpy` to lint ones with loop counters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
S-waiting-on-bors
Status: Waiting on bors to run and complete tests. Bors will change the label on completion.
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.
Found that this enum is not
Copy
while reviewing this Clippy PR: rust-lang/rust-clippy#5727 (comment)There shouldn't be a reason why this should not be
Copy
.