Skip to content

Conversation

@flip1995
Copy link
Member

r? @Manishearth

1 day late. Totally forgot about this yesterday.

AudaciousAxiom and others added 30 commits October 19, 2025 10:32
… r=jdonszelmann"

This reverts commit 5dc3c19, reversing
changes made to 11339a0.
will improve the diff for the next commit
- move `is_allowed_vec_method` (a stripped-down version of it, anyway,
  as the function doesn't make sense as is out of context) to utils, as
  it's shared between `useless_vec` and `ptr_arg`
- add another test for non-standard macro brace case
- rm unneeded `allow`s
- rm duplicated tests
- add comments to some tests
…ration_sugg`

This doesn't change any functionality, but will make it easier to switch
to a uniform message in the next commit. Also a nice simplification imo
changelog: [`sliced_string_as_bytes`]: don't fire on
`str[..].as_bytes()`

So I ran into this in some codebase I was working on,
where the lint fired on this line:
```rust
let string: &str;
string[..].as_bytes()
```
So I was trying to understand the rationale behind this lint, and it
says:
> It involves doing an unnecessary UTF-8 alignment check which is less
efficient, and can cause a panic.

This is obviously not true in the case where a `RangeFull` slice is
being taken, since there is no UTF-8 boundary check, and no panic can be
caused. So I created an exemption for `RangeFull`s.

Two other notes:
1. I'm not sure the word "alignment" in the lint's description (quoted
above) is really correct, should probably say "char boundary" instead?
2. I might be missing something, but isn't there a lint for doing
superfluous slice indexing, and then calling a slice method? e.g.
`str[..].len()` or `slice[..].len()`, where `str` and `slice` are `&str`
and `&[T]`, respectively. If we had one, I would expect *it* to fire for
the example code I quoted above.
@rustbot

This comment has been minimized.

@flip1995 flip1995 force-pushed the clippy-subtree-update branch from 08be39b to 0a1fa79 Compare November 28, 2025 19:25
@rustbot
Copy link
Collaborator

rustbot commented Nov 28, 2025

⚠️ Warning ⚠️

@matthiaskrgr
Copy link
Member

@bors r+ p=1 subtree sync

@bors
Copy link
Collaborator

bors commented Nov 28, 2025

📌 Commit 0a1fa79 has been approved by matthiaskrgr

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 Nov 28, 2025
@Manishearth
Copy link
Member

@bors r+ p=1 rollup=never

@bors
Copy link
Collaborator

bors commented Nov 28, 2025

💡 This pull request was already approved, no need to approve it again.

@bors
Copy link
Collaborator

bors commented Nov 28, 2025

📌 Commit 0a1fa79 has been approved by Manishearth

It is now in the queue for this repository.

@rust-log-analyzer
Copy link
Collaborator

The job pr-check-2 failed! Check out the build log: (web) (plain enhanced) (plain)

Click to see the possible cause of the failure (guessed by this bot)
    Checking tempfile v3.20.0
[RUSTC-TIMING] tempfile test:false 0.323
[RUSTC-TIMING] object test:false 6.212
    Checking rustc_codegen_gcc v0.1.0 (/checkout/compiler/rustc_codegen_gcc)
error: called `unwrap` on `bx.location` after checking its variant with `is_some`
   --> compiler/rustc_codegen_gcc/src/builder.rs:508:29
    |
506 |     if bx.location.is_some() {
    |     ------------------------ help: try: `if let Some(<item>) = bx.location`
507 |         #[cfg(feature = "master")]
508 |         rvalue.set_location(bx.location.unwrap());
    |                             ^^^^^^^^^^^^^^^^^^^^
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_unwrap
    = note: `-D clippy::unnecessary-unwrap` implied by `-D warnings`
    = help: to override `-D warnings` add `#[allow(clippy::unnecessary_unwrap)]`

@matthiaskrgr
Copy link
Member

lol
@bors r-

@bors bors added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels Nov 28, 2025
Zalathar added a commit to Zalathar/rust that referenced this pull request Nov 29, 2025
…gen-gcc-remove-unnecessary-unwrap, r=workingjubilee

Remove an unnecessary `unwrap` in `rustc_codegen_gcc`

This should hopefully unblock rust-lang#149425 (I couldn't find an in-flight PR that was already doing this).
I've tested  locally with the `master` version of Clippy that `rustc_codegen_gcc` passes the lints (the syncing PR could still fail for other reasons however).

I understand that `rustc_codegen_gcc` is normally developed [outside of this repo](https://github.com/rust-lang/rustc_codegen_gcc) but my understanding is that that repo is two-way synced regularly and hopefully it is acceptable to do this tiny change here to unblock the Clippy syncing PR (is there an established process for how to unblock these syncing PRs?). Of course feel free to close if this isn't the expected process.
rust-timer added a commit that referenced this pull request Nov 29, 2025
Rollup merge of #149449 - AudaciousAxiom:refactor/rustc-codegen-gcc-remove-unnecessary-unwrap, r=workingjubilee

Remove an unnecessary `unwrap` in `rustc_codegen_gcc`

This should hopefully unblock #149425 (I couldn't find an in-flight PR that was already doing this).
I've tested  locally with the `master` version of Clippy that `rustc_codegen_gcc` passes the lints (the syncing PR could still fail for other reasons however).

I understand that `rustc_codegen_gcc` is normally developed [outside of this repo](https://github.com/rust-lang/rustc_codegen_gcc) but my understanding is that that repo is two-way synced regularly and hopefully it is acceptable to do this tiny change here to unblock the Clippy syncing PR (is there an established process for how to unblock these syncing PRs?). Of course feel free to close if this isn't the expected process.
@matthiaskrgr
Copy link
Member

lets try this again
@bors r+

@bors
Copy link
Collaborator

bors commented Nov 29, 2025

📌 Commit 0a1fa79 has been approved by matthiaskrgr

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-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Nov 29, 2025
@bors
Copy link
Collaborator

bors commented Nov 29, 2025

⌛ Testing commit 0a1fa79 with merge 8a3a6bd...

@bors
Copy link
Collaborator

bors commented Nov 29, 2025

☀️ Test successful - checks-actions
Approved by: matthiaskrgr
Pushing 8a3a6bd to main...

@bors bors added the merged-by-bors This PR was explicitly merged by bors. label Nov 29, 2025
@bors bors merged commit 8a3a6bd into rust-lang:main Nov 29, 2025
4 of 12 checks passed
@rustbot rustbot added this to the 1.93.0 milestone Nov 29, 2025
@github-actions
Copy link
Contributor

What is this? This is an experimental post-merge analysis report that shows differences in test outcomes between the merged PR and its parent PR.

Comparing 0ad2cd3 (parent) -> 8a3a6bd (this PR)

Test differences

Show 2 test diffs

2 doctest diffs were found. These are ignored, as they are noisy.

Test dashboard

Run

cargo run --manifest-path src/ci/citool/Cargo.toml -- \
    test-dashboard 8a3a6bdb68b4d4c9ed922840808b02015741331e --output-dir test-dashboard

And then open test-dashboard/index.html in your browser to see an overview of all executed tests.

Job duration changes

  1. tidy: 148.8s -> 165.4s (+11.2%)
  2. dist-x86_64-apple: 6352.0s -> 7035.4s (+10.8%)
  3. dist-x86_64-solaris: 5050.9s -> 5585.2s (+10.6%)
  4. x86_64-mingw-1: 10666.2s -> 9629.1s (-9.7%)
  5. x86_64-msvc-ext1: 7742.1s -> 7083.3s (-8.5%)
  6. i686-msvc-1: 9805.4s -> 10613.5s (+8.2%)
  7. aarch64-apple: 7086.6s -> 7647.9s (+7.9%)
  8. dist-apple-various: 3776.6s -> 3483.1s (-7.8%)
  9. i686-msvc-2: 8050.7s -> 7539.2s (-6.4%)
  10. dist-powerpc64-linux: 5044.9s -> 5328.9s (+5.6%)
How to interpret the job duration changes?

Job durations can vary a lot, based on the actual runner instance
that executed the job, system noise, invalidated caches, etc. The table above is provided
mostly for t-infra members, for simpler debugging of potential CI slow-downs.

@rust-timer
Copy link
Collaborator

Finished benchmarking commit (8a3a6bd): comparison URL.

Overall result: no relevant changes - no action needed

@rustbot label: -perf-regression

Instruction count

This benchmark run did not return any relevant results for this metric.

Max RSS (memory usage)

This benchmark run did not return any relevant results for this metric.

Cycles

This benchmark run did not return any relevant results for this metric.

Binary size

This benchmark run did not return any relevant results for this metric.

Bootstrap: 471.605s -> 471.041s (-0.12%)
Artifact size: 386.91 MiB -> 386.90 MiB (-0.00%)

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. T-clippy Relevant to the Clippy team.

Projects

None yet

Development

Successfully merging this pull request may close these issues.