-
Notifications
You must be signed in to change notification settings - Fork 12.9k
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 and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Rename super_predicates_of
and similar queries to explicit_*
to note that they're not elaborated
#127045
Conversation
Some changes occurred in src/tools/clippy cc @rust-lang/clippy |
ad3cec8
to
c9870cf
Compare
@@ -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| { |
There was a problem hiding this comment.
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::*
. :/
There was a problem hiding this comment.
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 PolyTraitRef
s which it explicit does not.
There was a problem hiding this comment.
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.
This comment has been minimized.
This comment has been minimized.
@bors r+ |
Rename `super_predicates_of` and similar queries to `explicit_*` to note that they're not elaborated Rename: * `super_predicates_of` -> `explicit_super_predicates_of` * `implied_predicates_of` -> `explicit_implied_predicates_of` * `supertraits_containing_assoc_item` -> `explicit_supertraits_containing_assoc_item` This makes it clearer that, unlike (for example) [`TyCtxt::super_traits_of`](https://doc.rust-lang.org/nightly/nightly-rustc/rustc_middle/ty/context/struct.TyCtxt.html#method.super_traits_of), we don't automatically elaborate this set of predicates. r? `@lcnr` or `@oli-obk` or someone from t-types idc
…llaumeGomez Rollup of 10 pull requests Successful merges: - rust-lang#123714 (Add test for fn pointer duplication.) - rust-lang#124091 (Update AST validation module docs) - rust-lang#126963 (Add basic Serde serialization capabilities to Stable MIR) - rust-lang#127015 (Switch back `non_local_definitions` lint to allow-by-default) - rust-lang#127016 (docs: check if the disambiguator matches its suffix) - rust-lang#127029 (Fix Markdown tables in platform-support.md) - rust-lang#127032 (Enable const casting for `f16` and `f128`) - rust-lang#127041 (Migrate `run-make/override-aliased-flags` to `rmake.rs`) - rust-lang#127045 (Rename `super_predicates_of` and similar queries to `explicit_*` to note that they're not elaborated) - rust-lang#127075 (rustc_data_structures: Explicitly check for 64-bit atomics support) r? `@ghost` `@rustbot` modify labels: rollup
…iaskrgr Rollup of 9 pull requests Successful merges: - rust-lang#126822 (Bootstrap command refactoring: port more `Command` usages to `BootstrapCmd` (step 2)) - rust-lang#126835 (Simplifications in match lowering) - rust-lang#126953 (std: separate TLS key creation from TLS access) - rust-lang#127045 (Rename `super_predicates_of` and similar queries to `explicit_*` to note that they're not elaborated) - rust-lang#127075 (rustc_data_structures: Explicitly check for 64-bit atomics support) - rust-lang#127101 (remove redundant match statement from dataflow const prop) - rust-lang#127102 (Rename fuchsia builder and bump Fuchsia) - rust-lang#127103 (Move binder and polarity parsing into `parse_generic_ty_bound`) - rust-lang#127108 (unify `dylib` and `bin_helpers` and create `shared_helpers::parse_value_from_args`) r? `@ghost` `@rustbot` modify labels: rollup
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: * `super_predicates_of` -> `explicit_super_predicates_of` * `implied_predicates_of` -> `explicit_implied_predicates_of` * `supertraits_containing_assoc_item` -> `explicit_supertraits_containing_assoc_item` This makes it clearer that, unlike (for example) [`TyCtxt::super_traits_of`](https://doc.rust-lang.org/nightly/nightly-rustc/rustc_middle/ty/context/struct.TyCtxt.html#method.super_traits_of), we don't automatically elaborate this set of predicates. r? ``@lcnr`` or ``@oli-obk`` or someone from t-types idc
Rename `super_predicates_of` and similar queries to `explicit_*` to note that they're not elaborated Rename: * `super_predicates_of` -> `explicit_super_predicates_of` * `implied_predicates_of` -> `explicit_implied_predicates_of` * `supertraits_containing_assoc_item` -> `explicit_supertraits_containing_assoc_item` This makes it clearer that, unlike (for example) [`TyCtxt::super_traits_of`](https://doc.rust-lang.org/nightly/nightly-rustc/rustc_middle/ty/context/struct.TyCtxt.html#method.super_traits_of), we don't automatically elaborate this set of predicates. r? ``@lcnr`` or ``@oli-obk`` or someone from t-types idc
Rename:
super_predicates_of
->explicit_super_predicates_of
implied_predicates_of
->explicit_implied_predicates_of
supertraits_containing_assoc_item
->explicit_supertraits_containing_assoc_item
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