Skip to content

Clean up some traits#156021

Merged
rust-bors[bot] merged 5 commits intorust-lang:mainfrom
nnethercote:clean-up-some-traits
May 2, 2026
Merged

Clean up some traits#156021
rust-bors[bot] merged 5 commits intorust-lang:mainfrom
nnethercote:clean-up-some-traits

Conversation

@nnethercote
Copy link
Copy Markdown
Contributor

@nnethercote nnethercote commented May 1, 2026

I was looking at various traits and found some unnecessary trait bounds, and some unnecessary traits. Details in individual commits.

r? @Nadrieril

@rustbot
Copy link
Copy Markdown
Collaborator

rustbot commented May 1, 2026

Some changes occurred in exhaustiveness checking

cc @Nadrieril

rustc_error_messages was changed

cc @TaKO8Ki

@rustbot rustbot added A-translation Area: Translation infrastructure, and migrating existing diagnostics to SessionDiagnostic S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels May 1, 2026
@rustbot
Copy link
Copy Markdown
Collaborator

rustbot commented May 1, 2026

Nadrieril is currently at their maximum review capacity.
They may take a while to respond.

@rust-log-analyzer

This comment has been minimized.

It has a single method and a single impl and the trait isn't directly
used. It can just become an inherent method.
When you have `impl Foo for Bar` and `Bar` has no generics it's useless
(and odd) to have `where Self: Baz` bounds on methods when the trait
itself doesn't have those bounds. This commit removes a few.
FWIW, note that `Diagnostic` doesn't have this bound.
@nnethercote nnethercote force-pushed the clean-up-some-traits branch from d7f14d3 to 9119225 Compare May 1, 2026 03:33
@rust-log-analyzer
Copy link
Copy Markdown
Collaborator

The job x86_64-gnu-tools failed! Check out the build log: (web) (plain enhanced) (plain)

Click to see the possible cause of the failure (guessed by this bot)
  local time: Fri May  1 03:35:52 UTC 2026
  network time: Fri, 01 May 2026 03:35:52 GMT
##[endgroup]
sccache: Starting the server...
sccache: error: Server startup failed: cache storage failed to read: ConfigInvalid (permanent) at read => S3Error { code: "NoSuchBucket", message: "The specified bucket does not exist", resource: "", request_id: "1K1AZHQE18A8M48V" }

Context:
   uri: https://s3.us-west-1.amazonaws.com/rust-lang-ci-sccache2/.sccache_check
   response: Parts { status: 404, version: HTTP/1.1, headers: {"x-amz-request-id": "1K1AZHQE18A8M48V", "x-amz-id-2": "bCg8tcYfcWq6poWKOQDT7WHmJ4kaRu3WsiccWsvK3UCtGrP//HPOCpbxsmy/eKxatiePAMC94YTfke8qZeaOO9ldvfrOI5/Z", "content-type": "application/xml", "transfer-encoding": "chunked", "date": "Fri, 01 May 2026 03:35:52 GMT", "server": "AmazonS3"} }
   service: s3
   path: .sccache_check
   range: 0-

Backtrace:
---
[TIMING:end] compile::StdLink { compiler: Compiler { stage: 0, host: x86_64-unknown-linux-gnu, forced_compiler: false }, target_compiler: Compiler { stage: 0, host: x86_64-unknown-linux-gnu, forced_compiler: false }, target: x86_64-unknown-linux-gnu, crates: [], force_recompile: false } -- 0.001
##[group]Building stage1 compiler artifacts (stage0 -> stage1, x86_64-unknown-linux-gnu)
error: process didn't exit successfully: `sccache /checkout/obj/build/bootstrap/debug/rustc -vV` (exit status: 2)
--- stderr
sccache: error: Server startup failed: cache storage failed to read: ConfigInvalid (permanent) at read => S3Error { code: "NoSuchBucket", message: "The specified bucket does not exist", resource: "", request_id: "P9636RSR62Y0P898" }

Context:
   uri: https://s3.us-west-1.amazonaws.com/rust-lang-ci-sccache2/.sccache_check
   response: Parts { status: 404, version: HTTP/1.1, headers: {"x-amz-request-id": "P9636RSR62Y0P898", "x-amz-id-2": "as/7i9zfbHJvTZ+XTImWsnvMwJnHj/EC6mIPH9ac8mHB/PU3LjphiAHEFFrZE0tpvKwwBnxT5gI=", "content-type": "application/xml", "transfer-encoding": "chunked", "date": "Fri, 01 May 2026 03:36:54 GMT", "server": "AmazonS3"} }
   service: s3
   path: .sccache_check
   range: 0-

Backtrace:
---
  11: <unknown>
  12: <unknown>


Run with SCCACHE_LOG=debug SCCACHE_NO_DAEMON=1 to get more information

Bootstrap failed while executing `build --stage 2 compiler rustdoc`
Build completed unsuccessfully in 0:00:26
  local time: Fri May  1 03:36:55 UTC 2026
  network time: Fri, 01 May 2026 03:36:55 GMT

@jackh726
Copy link
Copy Markdown
Member

jackh726 commented May 1, 2026

@bors r+ rollup

r? jackh726

@rust-bors
Copy link
Copy Markdown
Contributor

rust-bors Bot commented May 1, 2026

📌 Commit 9119225 has been approved by jackh726

It is now in the queue for this repository.

@rust-bors rust-bors Bot added the S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. label May 1, 2026
@rust-bors rust-bors Bot removed the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label May 1, 2026
GuillaumeGomez added a commit to GuillaumeGomez/rust that referenced this pull request May 1, 2026
…r=jackh726

Clean up some traits

I was looking at various traits and found some unnecessary trait bounds, and some unnecessary traits. Details in individual commits.

r? @Nadrieril
rust-bors Bot pushed a commit that referenced this pull request May 1, 2026
Rollup of 7 pull requests

Successful merges:

 - #152487 (core: drop unmapped ZSTs in array `map`)
 - #155940 (refactor rustc_on_unimplemented's filtering)
 - #156020 (Improve source code for `librustdoc/visit_ast.rs`)
 - #156021 (Clean up some traits)
 - #156028 (Add a `Local::arg(i)` helper constructor)
 - #156037 (Add AcceptContext::expect_no_args)
 - #156040 (Add missing alias to mailmap)
GuillaumeGomez added a commit to GuillaumeGomez/rust that referenced this pull request May 1, 2026
…r=jackh726

Clean up some traits

I was looking at various traits and found some unnecessary trait bounds, and some unnecessary traits. Details in individual commits.

r? @Nadrieril
rust-bors Bot pushed a commit that referenced this pull request May 1, 2026
Rollup of 7 pull requests

Successful merges:

 - #155940 (refactor rustc_on_unimplemented's filtering)
 - #156020 (Improve source code for `librustdoc/visit_ast.rs`)
 - #156021 (Clean up some traits)
 - #156028 (Add a `Local::arg(i)` helper constructor)
 - #156037 (Add AcceptContext::expect_no_args)
 - #156040 (Add missing alias to mailmap)
 - #156048 (Make `diverging_type_vars` a vec of `TyVid`)
JonathanBrouwer added a commit to JonathanBrouwer/rust that referenced this pull request May 2, 2026
…r=jackh726

Clean up some traits

I was looking at various traits and found some unnecessary trait bounds, and some unnecessary traits. Details in individual commits.

r? @Nadrieril
rust-bors Bot pushed a commit that referenced this pull request May 2, 2026
…uwer

Rollup of 9 pull requests

Successful merges:

 - #156030 (Make stable hashing names consistent (part 1))
 - #156020 (Improve source code for `librustdoc/visit_ast.rs`)
 - #156021 (Clean up some traits)
 - #156028 (Add a `Local::arg(i)` helper constructor)
 - #156037 (Add AcceptContext::expect_no_args)
 - #156040 (Add missing alias to mailmap)
 - #156048 (Make `diverging_type_vars` a vec of `TyVid`)
 - #156053 (Reuse CTFE MIR for constructors.)
 - #156059 (compiler: Print valid `-Zmir-enable-passes` names if invalid name is used)

Failed merges:

 - #155940 (refactor rustc_on_unimplemented's filtering)
 - #156065 (Remove unused spans from AttributeKind)
@rust-bors rust-bors Bot merged commit 9149135 into rust-lang:main May 2, 2026
13 of 22 checks passed
@rustbot rustbot added this to the 1.97.0 milestone May 2, 2026
rust-timer added a commit that referenced this pull request May 2, 2026
Rollup merge of #156021 - nnethercote:clean-up-some-traits, r=jackh726

Clean up some traits

I was looking at various traits and found some unnecessary trait bounds, and some unnecessary traits. Details in individual commits.

r? @Nadrieril
@nnethercote nnethercote deleted the clean-up-some-traits branch May 3, 2026 23:22
github-actions Bot pushed a commit to rust-lang/rustc-dev-guide that referenced this pull request May 4, 2026
…uwer

Rollup of 9 pull requests

Successful merges:

 - rust-lang/rust#156030 (Make stable hashing names consistent (part 1))
 - rust-lang/rust#156020 (Improve source code for `librustdoc/visit_ast.rs`)
 - rust-lang/rust#156021 (Clean up some traits)
 - rust-lang/rust#156028 (Add a `Local::arg(i)` helper constructor)
 - rust-lang/rust#156037 (Add AcceptContext::expect_no_args)
 - rust-lang/rust#156040 (Add missing alias to mailmap)
 - rust-lang/rust#156048 (Make `diverging_type_vars` a vec of `TyVid`)
 - rust-lang/rust#156053 (Reuse CTFE MIR for constructors.)
 - rust-lang/rust#156059 (compiler: Print valid `-Zmir-enable-passes` names if invalid name is used)

Failed merges:

 - rust-lang/rust#155940 (refactor rustc_on_unimplemented's filtering)
 - rust-lang/rust#156065 (Remove unused spans from AttributeKind)
pull Bot pushed a commit to Kokoro2336/rust-analyzer that referenced this pull request May 4, 2026
…uwer

Rollup of 9 pull requests

Successful merges:

 - rust-lang/rust#156030 (Make stable hashing names consistent (part 1))
 - rust-lang/rust#156020 (Improve source code for `librustdoc/visit_ast.rs`)
 - rust-lang/rust#156021 (Clean up some traits)
 - rust-lang/rust#156028 (Add a `Local::arg(i)` helper constructor)
 - rust-lang/rust#156037 (Add AcceptContext::expect_no_args)
 - rust-lang/rust#156040 (Add missing alias to mailmap)
 - rust-lang/rust#156048 (Make `diverging_type_vars` a vec of `TyVid`)
 - rust-lang/rust#156053 (Reuse CTFE MIR for constructors.)
 - rust-lang/rust#156059 (compiler: Print valid `-Zmir-enable-passes` names if invalid name is used)

Failed merges:

 - rust-lang/rust#155940 (refactor rustc_on_unimplemented's filtering)
 - rust-lang/rust#156065 (Remove unused spans from AttributeKind)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-translation Area: Translation infrastructure, and migrating existing diagnostics to SessionDiagnostic S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants