Skip to content
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

Update Clippy #74792

Merged
merged 60 commits into from
Jul 26, 2020
Merged

Update Clippy #74792

merged 60 commits into from
Jul 26, 2020

Conversation

flip1995
Copy link
Member

Biweekly Clippy Sync

r? @Manishearth

flip1995 and others added 30 commits June 16, 2020 21:02
The "use .next()" replacement advice is on the last line of the code snippet,
where it is vulnerable to truncation. Display that advice at the beginning
instead.

closes rust-lang#5783
This lint catches cases where the last statement of a closure expecting
an instance of Ord has a trailing semi-colon. It compiles since the
closure ends up return () which also implements Ord but causes
unexpected results in cases such as sort_by_key.

Fixes rust-lang#5080

reprise: rebase, update and address all concerns
Reprise: new lint: Unintentional return of unit from closures expecting Ord

This lint catches cases where the last statement of a closure expecting
an instance of Ord has a trailing semi-colon. It compiles since the
closure ends up return () which also implements Ord but causes
unexpected results in cases such as sort_by_key.

Fixes rust-lang#5080

Reprise of rust-lang#5348 where I addressed all the comments there

changelog: add lint [`unit_return_expecting_ord`]
improve advice in iter_nth_zero

fixes rust-lang#5783

*Please keep the line below*
changelog:  For iter_nth_zero, the "use .next()" replacement advice is on the last line of the code snippet, where it is vulnerable to truncation. Display that advice at the beginning instead.
Add test for `needless_range_loop` issue

Closes rust-lang#2277

This was fixed when we fixed rust-lang#2542.

changelog: none
In various ways, such as changing functions to take a `Symbol` instead
of a `&str`.
…1995

Removing RHS snippet from SHADOW_UNRELATED message.

Fixes rust-lang#5703

I am not sure if I reinvented the wheel here, but I could not really find a snippet function that did this truncation, so I created the function. Please tell me if there was a more obvious way to do this, I am new here. 😄

changelog: Truncates multi-line RHS in shadow_unrelated message if it has more than 5 lines.
Backport remerge rust-1.44.1

r? @ghost

changelog: none
Since the beta/ directory already exists, we can't copy the complete master dir
Fix deploy script for beta deployment

Since the `beta/` directory already exists, we can't copy the complete `master` dir

changelog: none
It's intended only for very temporary use.
tnielens and others added 15 commits July 20, 2020 00:30
…atthiaskrgr

redundant_closure_call - don't lint when used more than once

Fixes rust-lang#3354.

changelog: fix redundant_closure_call false positive when closure called more than once
"Redundant" clones of `ManuallyDrop` are sometimes used for the side effect of
invoking the clone, without running the drop implementation of the inner type.
In other words, they aren't really redundant. For example, futures-rs crate:

```rust
#[allow(clippy::redundant_clone)] // The clone here isn't actually redundant.
unsafe fn increase_refcount<T: ArcWake>(data: *const ()) {
    // Retain Arc, but don't touch refcount by wrapping in ManuallyDrop
    let arc = mem::ManuallyDrop::new(Arc::<T>::from_raw(data as *const T));
    // Now increase refcount, but don't drop new refcount either
    let _arc_clone: mem::ManuallyDrop<_> = arc.clone();
}
```

Ignore redundant clone lint for ManuallyDrop.
…arth

Ignore not really redundant clones of ManuallyDrop

"Redundant" clones of `ManuallyDrop` are sometimes used for the side effect of
invoking the clone, without running the drop implementation of the inner type.
In other words, they aren't really redundant. For example, futures-rs crate:

```rust
#[allow(clippy::redundant_clone)] // The clone here isn't actually redundant.
unsafe fn increase_refcount<T: ArcWake>(data: *const ()) {
    // Retain Arc, but don't touch refcount by wrapping in ManuallyDrop
    let arc = mem::ManuallyDrop::new(Arc::<T>::from_raw(data as *const T));
    // Now increase refcount, but don't drop new refcount either
    let _arc_clone: mem::ManuallyDrop<_> = arc.clone();
}
```

changelog: Ignore redundant clone lint for ManuallyDrop.
This commit modifies the `substitute_normalize_and_test_predicates`
query, renaming it to `impossible_predicates` and only checking
predicates which do not require substs. By making this change,
polymorphization doesn't have to explicitly support vtables.

Signed-off-by: David Wood <david@davidtw.co>
trait_sel: only test predicates w/ no substs

r? @ghost
changelog: none
…earth

Update Usage section of README.md

Fixes rust-lang#5826

changelog: none
Use `(std::)f64::EPSILON` in the examples as suggested in the lints

`float_cmp(_const)` suggests using `{f32|f64}::EPSILON` and it'd be great if the docs mentioned it.

changelog: none
…=yaahc

Fix FP `useless_conversion`

Fix rust-lang#5833.

changelog: none
@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Jul 26, 2020
@Manishearth
Copy link
Member

@bors r+ p=1

@bors
Copy link
Contributor

bors commented Jul 26, 2020

📌 Commit e4e1b8c has been approved by Manishearth

@bors 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 Jul 26, 2020
@bors
Copy link
Contributor

bors commented Jul 26, 2020

⌛ Testing commit e4e1b8c with merge 6c8927b...

@bors
Copy link
Contributor

bors commented Jul 26, 2020

☀️ Test successful - checks-actions, checks-azure
Approved by: Manishearth
Pushing 6c8927b to master...

@bors bors added the merged-by-bors This PR was explicitly merged by bors. label Jul 26, 2020
@bors bors merged commit 6c8927b into rust-lang:master Jul 26, 2020
@flip1995 flip1995 deleted the clippyup branch July 27, 2020 00:13
@mark-i-m
Copy link
Member

@Mark-Simulacrum
Copy link
Member

See rust-lang/rustc-perf#728, some upstream (rustc-perf) work landed right before this commits benchmark.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
merged-by-bors This PR was explicitly merged by bors. S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion.
Projects
None yet
Development

Successfully merging this pull request may close these issues.