Skip to content
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

EarlyBinder as default #78

Closed
1 of 3 tasks
lcnr opened this issue Nov 21, 2022 · 3 comments
Closed
1 of 3 tasks

EarlyBinder as default #78

lcnr opened this issue Nov 21, 2022 · 3 comments
Labels
final-comment-period The FCP has started, most (if not all) team members are in agreement major-change A major change proposal T-types Add this label so rfcbot knows to poll the types team to-announce Announce this issue on triage meeting

Comments

@lcnr
Copy link
Contributor

lcnr commented Nov 21, 2022

Proposal

Change all queries which currently have a bound_X variant to return EarlyBinder<T> by default and remove the bound_X version. Add a method fn EarlyBinder::<T>::subst_identity(self) -> T if these queries are used in the identity context and don't need to actually substitute anything.

Not having EarlyBinder be the default can very easily result in incorrect uses of these queries, e.g. https://github.com/rust-lang/rust/blob/736c675d2ab65bcde6554e1b73340c2dbc27c85a/compiler/rustc_hir_analysis/src/astconv/mod.rs#L2720 which I found while reviewing rust-lang/rust#101947. The normalize_ty normalizes type_of(def_id) in the wrong environment as we only call subst afterwards.

Mentors or Reviewers

I am available to mentor and review this work.

Process

The main points of the Major Change Process are as follows:

  • File an issue describing the proposal.
  • A types team member or contributor who is knowledgeable in the area can second by writing @rustbot second.
    • Finding a "second" suffices for internal changes. If however, you are proposing a new public-facing feature, such as a -C flag, then full team check-off is required.
    • Types team members can initiate a check-off via @rfcbot fcp merge on either the MCP or the PR.
  • Once an MCP is seconded, the Final Comment Period begins. If no objections are raised after 10 days, the MCP is considered approved.

You can read more about Major Change Proposals on forge.

Comments

This issue is not meant to be used for technical discussion. There is a Zulip stream for that. Use this issue to leave procedural comments, such as volunteering to review, indicating that you second the proposal (or third, etc), or raising a concern that you would like to be addressed.

@lcnr lcnr added major-change A major change proposal T-types Add this label so rfcbot knows to poll the types team labels Nov 21, 2022
@rustbot
Copy link
Collaborator

rustbot commented Nov 21, 2022

This issue is not meant to be used for technical discussion. There is a Zulip stream for that. Use this issue to leave procedural comments, such as volunteering to review, indicating that you second the proposal (or third, etc), or raising a concern that you would like to be addressed.

cc @rust-lang/types

@rustbot rustbot added the to-announce Announce this issue on triage meeting label Nov 21, 2022
@oli-obk
Copy link
Contributor

oli-obk commented Nov 21, 2022

@rustbot second

@rustbot rustbot added the final-comment-period The FCP has started, most (if not all) team members are in agreement label Nov 21, 2022
@lcnr
Copy link
Contributor Author

lcnr commented Dec 16, 2022

closing as accepted

@lcnr lcnr closed this as completed Dec 16, 2022
bors added a commit to rust-lang-ci/rust that referenced this issue Jan 14, 2023
Switch to `EarlyBinder` for `const_param_default` and `impl_trait_ref` queries

Part of the work to close rust-lang#105779 and implement rust-lang/types-team#78.

Several queries `X` have a `bound_X` variant that wraps the output in `EarlyBinder`. This PR adds `EarlyBinder` to the return type of  `const_param_default` and `impl_trait_ref`, and removes their `bound_X` variants.

r? `@lcnr`
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this issue Jan 17, 2023
…s, r=lcnr

Switch to `EarlyBinder` for `item_bounds` query

Part of the work to finish rust-lang#105779 (also see rust-lang/types-team#78).

Several queries `X` have a `bound_X` variant that wraps the output in `EarlyBinder`. This adds `EarlyBinder` to the return type of the `item_bounds` query and removes `bound_item_bounds`.

r? `@lcnr`
bors added a commit to rust-lang-ci/rust that referenced this issue Jan 27, 2023
Switch to `EarlyBinder` for `fn_sig` query

Part of the work to finish rust-lang#105779 (also see rust-lang/types-team#78).

Several queries `X` have a `bound_X` variant that wraps the output in [`EarlyBinder`](https://doc.rust-lang.org/nightly/nightly-rustc/rustc_middle/ty/subst/struct.EarlyBinder.html). This adds `EarlyBinder` to the return type of the `fn_sig` query and removes `bound_fn_sig`.

r? `@lcnr`
bors added a commit to rust-lang/miri that referenced this issue Jan 31, 2023
Switch to `EarlyBinder` for `fn_sig` query

Part of the work to finish #105779 (also see rust-lang/types-team#78).

Several queries `X` have a `bound_X` variant that wraps the output in [`EarlyBinder`](https://doc.rust-lang.org/nightly/nightly-rustc/rustc_middle/ty/subst/struct.EarlyBinder.html). This adds `EarlyBinder` to the return type of the `fn_sig` query and removes `bound_fn_sig`.

r? `@lcnr`
bjorn3 pushed a commit to rust-lang/rustc_codegen_cranelift that referenced this issue Feb 6, 2023
Switch to `EarlyBinder` for `fn_sig` query

Part of the work to finish #105779 (also see rust-lang/types-team#78).

Several queries `X` have a `bound_X` variant that wraps the output in [`EarlyBinder`](https://doc.rust-lang.org/nightly/nightly-rustc/rustc_middle/ty/subst/struct.EarlyBinder.html). This adds `EarlyBinder` to the return type of the `fn_sig` query and removes `bound_fn_sig`.

r? `@lcnr`
ckxkexing added a commit to ckxkexing/rust that referenced this issue Feb 17, 2023
Switch to `EarlyBinder` for `type_of` query

Part of the work to finish rust-lang#105779 and implement rust-lang/types-team#78.

Several queries `X` have a `bound_X` variant that wraps the output in `EarlyBinder`. This adds `EarlyBinder` to the return type of the `type_of` query and removes `bound_type_of`.

r? `@lcnr`
bors added a commit to rust-lang-ci/rust that referenced this issue Feb 17, 2023
Switch to `EarlyBinder` for `type_of` query

Part of the work to finish rust-lang#105779 and implement rust-lang/types-team#78.

Several queries `X` have a `bound_X` variant that wraps the output in `EarlyBinder`. This adds `EarlyBinder` to the return type of the `type_of` query and removes `bound_type_of`.

r? `@lcnr`
RalfJung pushed a commit to RalfJung/miri that referenced this issue Feb 18, 2023
Switch to `EarlyBinder` for `type_of` query

Part of the work to finish #105779 and implement rust-lang/types-team#78.

Several queries `X` have a `bound_X` variant that wraps the output in `EarlyBinder`. This adds `EarlyBinder` to the return type of the `type_of` query and removes `bound_type_of`.

r? `@lcnr`
Jarcho pushed a commit to Jarcho/rust-clippy that referenced this issue Feb 25, 2023
Switch to `EarlyBinder` for `type_of` query

Part of the work to finish #105779 and implement rust-lang/types-team#78.

Several queries `X` have a `bound_X` variant that wraps the output in `EarlyBinder`. This adds `EarlyBinder` to the return type of the `type_of` query and removes `bound_type_of`.

r? `@lcnr`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
final-comment-period The FCP has started, most (if not all) team members are in agreement major-change A major change proposal T-types Add this label so rfcbot knows to poll the types team to-announce Announce this issue on triage meeting
Projects
None yet
Development

No branches or pull requests

3 participants