Skip to content

Conversation

mejrs
Copy link
Contributor

@mejrs mejrs commented Apr 26, 2025

We still check for rustc_on_unimplemented on implementations, but this functionality was removed in #139091, since then it always returns Ok when called with a non-trait defid.

pub fn of_item(tcx: TyCtxt<'tcx>, item_def_id: DefId) -> Result<Option<Self>, ErrorGuaranteed> {
if !tcx.is_trait(item_def_id) {
// It could be a trait_alias (`trait MyTrait = SomeOtherTrait`)
// or an implementation (`impl MyTrait for Foo {}`)
//
// We don't support those.
return Ok(None);
}

@rustbot
Copy link
Collaborator

rustbot commented Apr 26, 2025

r? @jackh726

rustbot has assigned @jackh726.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

@rustbot rustbot added 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 Apr 26, 2025
@compiler-errors
Copy link
Member

r? compiler-errors @bors r+ rollup

@bors
Copy link
Collaborator

bors commented Apr 26, 2025

📌 Commit 1ec3e62 has been approved by compiler-errors

It is now in the queue for this repository.

@rustbot rustbot assigned compiler-errors and unassigned jackh726 Apr 26, 2025
@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 26, 2025
jhpratt added a commit to jhpratt/rust that referenced this pull request Apr 26, 2025
Remove redundant check

We still check for `rustc_on_unimplemented` on implementations, but this functionality was removed in rust-lang#139091, since then it always returns `Ok` when called with a non-trait defid.

https://github.com/rust-lang/rust/blob/b4c8b0c3f0533bb342a4873ff59bdad3883ab8e3/compiler/rustc_trait_selection/src/error_reporting/traits/on_unimplemented.rs#L557-L564
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this pull request Apr 26, 2025
Remove redundant check

We still check for `rustc_on_unimplemented` on implementations, but this functionality was removed in rust-lang#139091, since then it always returns `Ok` when called with a non-trait defid.

https://github.com/rust-lang/rust/blob/b4c8b0c3f0533bb342a4873ff59bdad3883ab8e3/compiler/rustc_trait_selection/src/error_reporting/traits/on_unimplemented.rs#L557-L564
bors added a commit to rust-lang-ci/rust that referenced this pull request Apr 26, 2025
…iaskrgr

Rollup of 7 pull requests

Successful merges:

 - rust-lang#123239 (Implement a lint for implicit autoref of raw pointer dereference - take 2)
 - rust-lang#140215 (transmutability: Support char, NonZeroXxx)
 - rust-lang#140226 (Update wasm-component-ld to 0.5.13)
 - rust-lang#140302 (Move inline asm check to typeck, properly handle aliases)
 - rust-lang#140317 (Remove redundant check)
 - rust-lang#140318 (Simply try to unpeel AsyncFnKindHelper goal in `emit_specialized_closure_kind_error`)
 - rust-lang#140325 (Grammar fixes for BufRead::has_data_left docs)

r? `@ghost`
`@rustbot` modify labels: rollup
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this pull request Apr 26, 2025
Remove redundant check

We still check for `rustc_on_unimplemented` on implementations, but this functionality was removed in rust-lang#139091, since then it always returns `Ok` when called with a non-trait defid.

https://github.com/rust-lang/rust/blob/b4c8b0c3f0533bb342a4873ff59bdad3883ab8e3/compiler/rustc_trait_selection/src/error_reporting/traits/on_unimplemented.rs#L557-L564
bors added a commit to rust-lang-ci/rust that referenced this pull request Apr 26, 2025
…iaskrgr

Rollup of 6 pull requests

Successful merges:

 - rust-lang#123239 (Implement a lint for implicit autoref of raw pointer dereference - take 2)
 - rust-lang#140215 (transmutability: Support char, NonZeroXxx)
 - rust-lang#140226 (Update wasm-component-ld to 0.5.13)
 - rust-lang#140317 (Remove redundant check)
 - rust-lang#140318 (Simply try to unpeel AsyncFnKindHelper goal in `emit_specialized_closure_kind_error`)
 - rust-lang#140325 (Grammar fixes for BufRead::has_data_left docs)

r? `@ghost`
`@rustbot` modify labels: rollup
bors added a commit to rust-lang-ci/rust that referenced this pull request Apr 26, 2025
…iaskrgr

Rollup of 6 pull requests

Successful merges:

 - rust-lang#140215 (transmutability: Support char, NonZeroXxx)
 - rust-lang#140226 (Update wasm-component-ld to 0.5.13)
 - rust-lang#140317 (Remove redundant check)
 - rust-lang#140318 (Simply try to unpeel AsyncFnKindHelper goal in `emit_specialized_closure_kind_error`)
 - rust-lang#140320 (replace `GenericArg` with `Term` where applicable)
 - rust-lang#140325 (Grammar fixes for BufRead::has_data_left docs)

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors merged commit fbf6832 into rust-lang:master Apr 26, 2025
6 checks passed
@rustbot rustbot added this to the 1.88.0 milestone Apr 26, 2025
rust-timer added a commit to rust-lang-ci/rust that referenced this pull request Apr 26, 2025
Rollup merge of rust-lang#140317 - mejrs:check_on_uni, r=compiler-errors

Remove redundant check

We still check for `rustc_on_unimplemented` on implementations, but this functionality was removed in rust-lang#139091, since then it always returns `Ok` when called with a non-trait defid.

https://github.com/rust-lang/rust/blob/b4c8b0c3f0533bb342a4873ff59bdad3883ab8e3/compiler/rustc_trait_selection/src/error_reporting/traits/on_unimplemented.rs#L557-L564
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
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