Skip to content

Update Clippy #110718

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

Merged
merged 59 commits into from
Apr 24, 2023
Merged

Update Clippy #110718

merged 59 commits into from
Apr 24, 2023

Conversation

flip1995
Copy link
Member

r? @Manishearth

A few days late, I was on a business trip, sorry.

robertbastian and others added 30 commits April 6, 2023 16:31
…_types, r=xFrednet

Test all types supported by [`collection_is_never_read`]

changelog: none
… r=Alexendoo

Standardize lint formulation

Fixes rust-lang#10631

changelog: Standardize a very frequent lint formulation which had variations
…Jarcho

Fix UB in `as_ptr_cast_mut` documentation

changelog: none

Fixes rust-lang#10628

There's no `String::as_mut_ptr` surprisingly, so the example is actually calling `str::as_mut_ptr` on an empty `str`
Fix false positives and false negatives in `octal_escapes`
Clippy Book Chapter Updates Reborn: Lint Passes

This PR adds a new chapter to the book: "Lint passes". No major changes apart from some re-phrasing, fixing typos... etc.

## Notes

- Requires rust-lang#10595 to be merged before this one (Or else, a link will be broken).
- To talk about the whole project, please use the tracking issue for the project rust-lang#10597 (It also contains a timeline, discussions and more information)

changelog: Add a new "Lint passes" chapter to the book
r? `@flip1995`
Adds the lint passes chapter to the index.

Moves additional reading material for beginners to the front page of the
development section.

Clarify some details in hir::Ty vs ty::Ty.
…, r=llogiq

Book: Improve type checking and lint passes chapters

- Adds the lint passes chapter to the index.
- Moves additional reading material for beginners to the front page of the development section.
- Clarify some details in `hir::Ty` vs `ty::Ty`.

`@blyxyas` I started reviewing the chapters that were already merged. Great work. I liked the additional reading chapter so much, that I moved it front and center. Other than that I only had some minor corrections to make. Please review.

r? `@llogiq`

changelog: none
…1995

Clippy Book Chapter Updates Reborn: Macro Expansions

This PR adds a new chapter to the book: "Macro Expansions". There weren't big changes apart from grammar, re-phrasing and stylistic choices.

## Notes

- **Does not require any other chapter** to be merged before this
- To talk about the whole project, please use the tracking issue for the project rust-lang#10597 (It also contains a timeline, discussions and more information)

changelog: Add a new "Macro Expansions" chapter to the book

r? `@flip1995`
Suggest `std::mem::size_of_val` instead of `std::mem::size_of_value`

This fixes the incorrect suggestion to use `std::mem::size_of_value`. It should be [`std::mem::size_of_val`](https://doc.rust-lang.org/std/mem/fn.size_of_val.html).

changelog: [`manual_slice_size_calculation`]: suggest `std::mem::size_of_val` rather than `std::mem::size_of_value`
…stion, r=Manishearth

Add `manual_slice_size_calculation` applicable suggestion

Continuation of rust-lang/rust-clippy#10659 (comment).

This adds applicable suggestions to the `manual_slice_size_calculation` lint:

```
error: manual slice size calculation
  --> $DIR/manual_slice_size_calculation.rs:11:13
   |
LL |     let _ = s_i32.len() * size_of::<i32>(); // WARNING
   |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `std::mem::size_of_val(s_i32)`
   |
   = note: `-D clippy::manual-slice-size-calculation` implied by `-D warnings`
```

changelog: [`manual_slice_size_calculation`]: add machine applicable suggestion
blyxyas and others added 10 commits April 22, 2023 21:12
…=flip1995

Fix `#[allow(clippy::enum_variant_names)]` directly on variants

changelog: [`enum_variant_names`]: Fix `#[allow]` attributes applied directly to the enum variant

Fixes rust-lang#10695
make [`len_zero`] lint not spanning over parenthesis

sorry it should be a quick fix but I was caught up by other stuffs last couple weeks 🤦‍♂️

---

fixes: rust-lang#10529

changelog: make [`len_zero`] lint not spanning over parenthesis
clippy: drop unused semver crate

Drop unused `semver` crate dependency.

changelog: none
…, r=llogiq

Bugfix: Ignore `impl Trait`(s) @ `let_underscore_untyped`

Fixes rust-lang#10411

changelog:[`let_underscore_untyped`]: Ignore `impl Trait`(s) that caused false positives.
Add `items_after_test_module` lint

Resolves task *3* of rust-lang#10506, alongside *1* resolved at rust-lang#10543 in an effort to help standarize a little bit more testing modules.

---

changelog:[`items_after_test_module`]: Added the lint.
@rustbot rustbot added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Apr 23, 2023
@rustbot
Copy link
Collaborator

rustbot commented Apr 23, 2023

These commits modify the Cargo.lock file. Random changes to Cargo.lock can be introduced when switching branches and rebasing PRs.
This was probably unintentional and should be reverted before this PR is merged.

If this was intentional then you can ignore this comment.

Some changes occurred in src/tools/clippy

cc @rust-lang/clippy

@flip1995
Copy link
Member Author

@bors rollup=iffy (Cargo.lock update)

@rust-log-analyzer

This comment has been minimized.

@Manishearth
Copy link
Member

clippy/development/lint_passes.html:194: broken link - `clippy/development/define_lints.html`
clippy/print.html:1827: broken link - `clippy/development/define_lints.html`

@flip1995
Copy link
Member Author

We might want to include linkchecker from rustc into our CI.

@Manishearth
Copy link
Member

@bors r+ p=1

@bors
Copy link
Collaborator

bors commented Apr 24, 2023

📌 Commit bb63b59 has been approved by Manishearth

It is now in the queue for this repository.

@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 Apr 24, 2023
@bors
Copy link
Collaborator

bors commented Apr 24, 2023

⌛ Testing commit bb63b59 with merge f5559e3...

@bors
Copy link
Collaborator

bors commented Apr 24, 2023

☀️ Test successful - checks-actions
Approved by: Manishearth
Pushing f5559e3 to master...

@bors bors added the merged-by-bors This PR was explicitly merged by bors. label Apr 24, 2023
@bors bors merged commit f5559e3 into rust-lang:master Apr 24, 2023
@rustbot rustbot added this to the 1.71.0 milestone Apr 24, 2023
@rust-timer
Copy link
Collaborator

Finished benchmarking commit (f5559e3): comparison URL.

Overall result: ✅ improvements - no action needed

@rustbot label: -perf-regression

Instruction count

This is a highly reliable metric that was used to determine the overall result at the top of this comment.

mean range count
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
0.9% [0.9%, 0.9%] 1
Improvements ✅
(primary)
-2.0% [-2.8%, -0.8%] 3
Improvements ✅
(secondary)
-6.0% [-7.5%, -4.9%] 6
All ❌✅ (primary) -2.0% [-2.8%, -0.8%] 3

Max RSS (memory usage)

Results

This is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.

mean range count
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
-2.8% [-2.8%, -2.8%] 1
All ❌✅ (primary) - - 0

Cycles

Results

This is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.

mean range count
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
-3.4% [-4.3%, -2.5%] 4
All ❌✅ (primary) - - 0

flip1995 pushed a commit to flip1995/rust that referenced this pull request May 5, 2023
Update Clippy

r? `@Manishearth`

A few days late, I was on a business trip, sorry.
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.