Skip to content

Enforce even more library clippy lints in CI - #161328

Open
ChrisDenton wants to merge 34 commits into
rust-lang:mainfrom
ChrisDenton:clippy3
Open

Enforce even more library clippy lints in CI#161328
ChrisDenton wants to merge 34 commits into
rust-lang:mainfrom
ChrisDenton:clippy3

Conversation

@ChrisDenton

@ChrisDenton ChrisDenton commented Aug 18, 2026

Copy link
Copy Markdown
Member

View all comments

Once again, this is best reviewed commit-by-commit since each commit fixes a lint.

I've bundled together a large(ish) number of lints because I feel they shouldn't be controversial and don't touch too much code. A large chunk of them is just telling clippy that, for example, implementing is_digit by calling is_digit just isn't going to work. I have reviewed each and every fix myself but please do double or triple check my working!

@rustbot

rustbot commented Aug 18, 2026

Copy link
Copy Markdown
Collaborator

Some changes occurred to the intrinsics. Make sure the CTFE / Miri interpreter
gets adapted for the changes, if necessary.

cc @rust-lang/miri, @RalfJung, @oli-obk, @lcnr

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-libs Relevant to the library team, which will review and decide on the PR/issue. labels Aug 18, 2026
@ChrisDenton

Copy link
Copy Markdown
Member Author

Btw, they'll likely be platform specific fixes that CI tells me about so I'll probably be updating these in a few hours.

Comment thread library/core/src/intrinsics/mod.rs Outdated
@matthiaskrgr

Copy link
Copy Markdown
Member

@bors try @rust-timer queue

@rust-timer

This comment has been minimized.

@rustbot rustbot added the S-waiting-on-perf Status: Waiting on a perf run to be completed. label Aug 18, 2026
@rust-bors

This comment has been minimized.

rust-bors Bot pushed a commit that referenced this pull request Aug 18, 2026
Enforce even more library clippy lints in CI
@rustbot rustbot added the T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) label Aug 18, 2026
Comment thread library/core/src/slice/mod.rs Outdated

@nia-e nia-e left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

mostly looks good, with a couple worries:

  • clippy wants us to do a lot more method calls. this is fine but needs a perf run for sure, and i'm a smidge worried about binary size and/or bootstrap time, esp since it might put more pressure on the inliner
  • a lot of these allows should be expects with a comment... but also, i'm not gonna do that to you chris ^^ that can be a later pr

let's see what a perf run comes up with before anything.

@bors try @rust-timer queue

View changes since this review

Comment thread library/core/src/char/methods.rs Outdated
Comment thread library/core/src/num/f32.rs
Comment thread library/core/src/intrinsics/mod.rs
@rust-bors

This comment has been minimized.

rust-bors Bot pushed a commit that referenced this pull request Aug 18, 2026
Enforce even more library clippy lints in CI
@nia-e

nia-e commented Aug 18, 2026

Copy link
Copy Markdown
Member

huh, how did the comment from matthias not show up? apologies ^^ github has been odd

@rust-log-analyzer

This comment has been minimized.

Comment thread src/bootstrap/src/core/build_steps/clippy.rs Outdated
@rust-bors

rust-bors Bot commented Aug 18, 2026

Copy link
Copy Markdown
Contributor

☀️ Try build successful (CI)
Build commit: 8906bf7 (8906bf76a8be8117da1f6c656fd34abfa6ebb3a0)
Base parent: e71c0f1 (e71c0f1e3395b10a8c331317be1a5c107bdf7b2e)

@rust-timer

This comment has been minimized.

@clarfonthey

Copy link
Copy Markdown
Contributor

Just comparing to my personal clippy lint list, what I see missing is:

  • borrow_as_ptr
  • default_trait_access
  • doc_markdown
  • filter_map_next
  • if_not_else
  • ignored_unit_patterns
  • inconsistent_struct_constructor
  • manual_assert
  • manual_is_power_of_two
  • map_unwrap_or
  • match_same_arms
  • missing_docs_in_private_items (the spiciest one, imho)
  • `needless_continue
  • needless_raw_string_hashes
  • redundant_closure_for_method_calls
  • redundant_else
  • ref_as_ptr
  • semicolon_if_nothing_returned
  • unnecessary_semicolon

Besides missing_docs_in_private_items being almost certainly undesired at the moment (unless we want more untriaged comments), I haven't actually checked which of these are most reasonable for libstd.

@rust-log-analyzer

This comment has been minimized.

@rust-log-analyzer

This comment has been minimized.

@rust-timer

Copy link
Copy Markdown
Collaborator

Finished benchmarking commit (8906bf7): comparison URL.

Overall result: ❌ regressions - no action needed

Benchmarking means the PR may be perf-sensitive. Consider adding rollup=never if this change is not fit for rolling up.

@rustbot label: -S-waiting-on-perf -perf-regression

Instruction count

Our most reliable metric. Used to determine the overall result above. However, even this metric can be noisy.

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

Max RSS (memory usage)

Results (primary 0.9%, secondary 0.5%)

A less reliable metric. May be of interest, but not used to determine the overall result above.

mean range count
Regressions ❌
(primary)
2.3% [2.1%, 2.4%] 2
Regressions ❌
(secondary)
3.3% [3.3%, 3.3%] 1
Improvements ✅
(primary)
-1.9% [-1.9%, -1.9%] 1
Improvements ✅
(secondary)
-2.2% [-2.2%, -2.2%] 1
All ❌✅ (primary) 0.9% [-1.9%, 2.4%] 3

Cycles

This perf run didn't have relevant results for this metric.

Binary size

Results (primary -0.1%, secondary -0.1%)

A less reliable metric. May be of interest, but not used to determine the overall result above.

mean range count
Regressions ❌
(primary)
0.3% [0.0%, 0.5%] 2
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
-0.1% [-0.2%, -0.0%] 21
Improvements ✅
(secondary)
-0.1% [-0.1%, -0.0%] 80
All ❌✅ (primary) -0.1% [-0.2%, 0.5%] 23

Bootstrap: 456.919s -> 457.665s (0.16%)
Artifact size: 398.99 MiB -> 398.96 MiB (-0.01%)

@rustbot rustbot removed the S-waiting-on-perf Status: Waiting on a perf run to be completed. label Aug 19, 2026
@rustbot

rustbot commented Aug 24, 2026

Copy link
Copy Markdown
Collaborator

This PR was rebased onto a different main commit. Here's a range-diff highlighting what actually changed.

Rebasing is a normal part of keeping PRs up to date, so no action is needed—this note is just to help reviewers.

@GTimothy

Copy link
Copy Markdown
Contributor

This PR was rebased onto a different main commit. Here's a range-diff highlighting what actually changed.

Oops, sorry for that. Got inspired by reviewing you changes here :)

@ChrisDenton

Copy link
Copy Markdown
Member Author

It's totally fine! The change is minor and as the message says, rebasing is a normal part of managing PRs,

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

Labels

S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) T-libs Relevant to the library team, which will review and decide on the PR/issue.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

9 participants