Skip to content

Update Clippy - #74792

Merged
bors merged 60 commits into
rust-lang:masterfrom
flip1995:clippyup
Jul 26, 2020
Merged

Update Clippy#74792
bors merged 60 commits into
rust-lang:masterfrom
flip1995:clippyup

Conversation

@flip1995

Copy link
Copy Markdown
Member

Biweekly Clippy Sync

r? @Manishearth

flip1995and 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.
closesrust-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.
Fixesrust-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.
Fixesrust-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
fixesrust-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
Closesrust-lang#2277
This was fixed when we fixedrust-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.
Fixesrust-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.
tnielensand others added 15 commits July 20, 2020 00:30
…atthiaskrgr
redundant_closure_call - don't lint when used more than once
Fixesrust-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
Fixesrust-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`
Fixrust-lang#5833.
changelog: none
@rust-highfiverust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Jul 26, 2020
@Manishearth

Copy link
Copy Markdown
Member

@bors r+ p=1

@bors

bors commented Jul 26, 2020

Copy link
Copy Markdown
Collaborator

📌 Commit e4e1b8c has been approved by Manishearth

@borsbors 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

bors commented Jul 26, 2020

Copy link
Copy Markdown
Collaborator

⌛ Testing commit e4e1b8c with merge 6c8927b...

@bors

bors commented Jul 26, 2020

Copy link
Copy Markdown
Collaborator

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

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

Copy link
Copy Markdown
Contributor

@Mark-Simulacrum

Copy link
Copy Markdown
Member

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

Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

merged-by-borsThis PR was explicitly merged by bors.S-waiting-on-borsStatus: 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.

20 participants

@flip1995@Manishearth@bors@mark-i-m@Mark-Simulacrum@cuviper@rust-highfive@ebroto@warner@matthiaskrgr@nnethercote@lcnr@Leulz@JarredAllen@Lezzz@giraffate@tnielens@tmiasko@davidtwco@JohnTitor