Rename super_predicates_of and similar queries to explicit_* to note that they're not elaborated by compiler-errors · Pull Request #127045 · rust-lang/rust (original) (raw)

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 andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Conversation7 Commits3 Checks7 Files changed

Conversation

This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters

[ Show hidden characters]({{ revealButtonHref }})

compiler-errors

Rename:

This makes it clearer that, unlike (for example) TyCtxt::super_traits_of, we don't automatically elaborate this set of predicates.

r? @lcnr or @oli-obk or someone from t-types idc

@compiler-errors

@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.

T-rustdoc

Relevant to the rustdoc team, which will review and decide on the PR/issue.

labels

Jun 27, 2024

@rustbot

Some changes occurred in src/tools/clippy

cc @rust-lang/clippy

@compiler-errors

compiler-errors

@@ -2440,7 +2443,7 @@ impl<'tcx> TyCtxt<'tcx> {
/// Given the def_id of a Trait `trait_def_id` and the name of an associated item `assoc_name`
/// returns true if the `trait_def_id` defines an associated item of name `assoc_name`.
pub fn trait_may_define_assoc_item(self, trait_def_id: DefId, assoc_name: Ident) -> bool {
self.super_traits_of(trait_def_id).any(|trait_did
self.supertrait_def_ids(trait_def_id).any(|trait_did

Choose a reason for hiding this comment

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

side-note: I kinda dislike that this is a method on TyCtxt. It makes it look like a query, and it's not like the other elaborator-like which are functions in util::*. :/

Choose a reason for hiding this comment

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

Also I renamed this to supertrait_def_ids since super_traits_of makes it seem like it returns PolyTraitRefs which it explicit does not.

Choose a reason for hiding this comment

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

hahaha renaming this made it clear that there were two methods in rustc_middle that did the same -- I deduplicated them in a follow-up commit.

@rust-log-analyzer

This comment has been minimized.

@compiler-errors

@oli-obk

@bors

📌 Commit 1160eec has been approved by oli-obk

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

Jun 28, 2024

GuillaumeGomez added a commit to GuillaumeGomez/rust that referenced this pull request

Jun 28, 2024

@GuillaumeGomez

Rename super_predicates_of and similar queries to explicit_* to note that they're not elaborated

Rename:

This makes it clearer that, unlike (for example) TyCtxt::super_traits_of, we don't automatically elaborate this set of predicates.

r? @lcnr or @oli-obk or someone from t-types idc

bors added a commit to rust-lang-ci/rust that referenced this pull request

Jun 28, 2024

@bors

…llaumeGomez

Rollup of 10 pull requests

Successful merges:

r? @ghost @rustbot modify labels: rollup

bors added a commit to rust-lang-ci/rust that referenced this pull request

Jun 29, 2024

@bors

…iaskrgr

Rollup of 9 pull requests

Successful merges:

r? @ghost @rustbot modify labels: rollup

rust-timer added a commit to rust-lang-ci/rust that referenced this pull request

Jun 29, 2024

@rust-timer

Rollup merge of rust-lang#127045 - compiler-errors:explicit, r=oli-obk

Rename super_predicates_of and similar queries to explicit_* to note that they're not elaborated

Rename:

This makes it clearer that, unlike (for example) TyCtxt::super_traits_of, we don't automatically elaborate this set of predicates.

r? @lcnr or @oli-obk or someone from t-types idc

flip1995 pushed a commit to flip1995/rust that referenced this pull request

Jul 11, 2024

@matthiaskrgr

Rename super_predicates_of and similar queries to explicit_* to note that they're not elaborated

Rename:

This makes it clearer that, unlike (for example) TyCtxt::super_traits_of, we don't automatically elaborate this set of predicates.

r? @lcnr or @oli-obk or someone from t-types idc

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.

T-rustdoc

Relevant to the rustdoc team, which will review and decide on the PR/issue.

WG-trait-system-refactor

The Rustc Trait System Refactor Initiative (-Znext-solver)