-
Notifications
You must be signed in to change notification settings - Fork 12.8k
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
Switch to EarlyBinder
for type_of
query
#107753
Conversation
Some changes occurred in need_type_info.rs cc @lcnr Some changes occurred to MIR optimizations cc @rust-lang/wg-mir-opt Some changes occurred to the CTFE / Miri engine cc @rust-lang/miri The Miri subtree was changed cc @rust-lang/miri Some changes occurred in src/tools/clippy cc @rust-lang/clippy Some changes occurred to the core trait solver cc @rust-lang/initiative-trait-system-refactor |
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.
Here are the places where I thought there were potential substs
but wasn't sure whether they should be used
@@ -906,8 +906,14 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> { | |||
// different from the received one | |||
// So we avoid suggestion method with Box<Self> | |||
// for instance | |||
self.tcx.at(span).type_of(*def_id) != rcvr_ty | |||
&& self.tcx.at(span).type_of(*def_id) != rcvr_ty |
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.
This is sort of unrelated to adding EarlyBinder
, but I was confused by this... what's going on here?
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.
yeah this is really odd lol I have no idea why its checking the same condition twice...
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.
Hi, so I did a little digging on this and tracked it down to #104422 (which renamed actual
to rcvr_ty
, whereas originally both names were in scope). I might try to think of a test case where the original check is needed
compiler/rustc_symbol_mangling/src/typeid/typeid_itanium_cxx_abi.rs
Outdated
Show resolved
Hide resolved
☔ The latest upstream changes (presumably #107768) made this pull request unmergeable. Please resolve the merge conflicts. |
r? @BoxyUwU |
handing this off to @BoxyUwU as I don't have a lot of time atm ^^ I realized is that the reason I didn't see your comments in your previous PR was that they are for the commit which uses Thanks for your work ❤️ |
☔ The latest upstream changes (presumably #107924) made this pull request unmergeable. Please resolve the merge conflicts. |
compiler/rustc_trait_selection/src/traits/select/confirmation.rs
Outdated
Show resolved
Hide resolved
Hi @BoxyUwU, thanks for reviewing! I implemented all of those changes in the 2nd to last commit; the last commit is just a small change that came up when I rebased 😃 |
☔ The latest upstream changes (presumably #108079) made this pull request unmergeable. Please resolve the merge conflicts. |
☔ The latest upstream changes (presumably #108006) made this pull request unmergeable. Please resolve the merge conflicts. |
☔ The latest upstream changes (presumably #108096) made this pull request unmergeable. Please resolve the merge conflicts. |
☔ The latest upstream changes (presumably #108020) made this pull request unmergeable. Please resolve the merge conflicts. |
Finished benchmarking commit (9556b56): comparison URL. Overall result: ✅ improvements - no action needed@rustbot label: -perf-regression Instruction countThis is a highly reliable metric that was used to determine the overall result at the top of this comment.
Max RSS (memory usage)This benchmark run did not return any relevant results for this metric. CyclesResultsThis is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.
|
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`
Remove some superfluous type parameters from layout.rs rust-lang/rust#107163 Introduce -Zterminal-urls to use OSC8 for error codes rust-lang/rust#107838 Unify validity checks into a single query rust-lang/rust#108364 s/eval_usize/eval_target_usize/ for clarity rust-lang/rust#108029 Use target instead of machine for mir interpreter integer handling rust-lang/rust#108047 Switch to EarlyBinder for type_of query rust-lang/rust#107753 Rename interner funcs rust-lang/rust#108250 Optimize mk_region rust-lang/rust#108020 Clarify iterator interners rust-lang/rust#108112
- Remove some superfluous type parameters from layout.rs rust-lang/rust#107163 - Introduce -Zterminal-urls to use OSC8 for error codes rust-lang/rust#107838 - Unify validity checks into a single query rust-lang/rust#108364 - s/eval_usize/eval_target_usize/ for clarity rust-lang/rust#108029 - Use target instead of machine for mir interpreter integer handling rust-lang/rust#108047 - Switch to EarlyBinder for type_of query rust-lang/rust#107753 - Rename interner funcs rust-lang/rust#108250 - Optimize mk_region rust-lang/rust#108020 - Clarify iterator interners rust-lang/rust#108112
- Remove some superfluous type parameters from layout.rs rust-lang/rust#107163 - Introduce -Zterminal-urls to use OSC8 for error codes rust-lang/rust#107838 - Unify validity checks into a single query rust-lang/rust#108364 - s/eval_usize/eval_target_usize/ for clarity rust-lang/rust#108029 - Use target instead of machine for mir interpreter integer handling rust-lang/rust#108047 - Switch to EarlyBinder for type_of query rust-lang/rust#107753 - Rename interner funcs rust-lang/rust#108250 - Optimize mk_region rust-lang/rust#108020 - Clarify iterator interners rust-lang/rust#108112
- Remove some superfluous type parameters from layout.rs rust-lang/rust#107163 - Introduce -Zterminal-urls to use OSC8 for error codes rust-lang/rust#107838 - Unify validity checks into a single query rust-lang/rust#108364 - s/eval_usize/eval_target_usize/ for clarity rust-lang/rust#108029 - Use target instead of machine for mir interpreter integer handling rust-lang/rust#108047 - Switch to EarlyBinder for type_of query rust-lang/rust#107753 - Rename interner funcs rust-lang/rust#108250 - Optimize mk_region rust-lang/rust#108020 - Clarify iterator interners rust-lang/rust#108112
- Remove some superfluous type parameters from layout.rs rust-lang/rust#107163 - Introduce -Zterminal-urls to use OSC8 for error codes rust-lang/rust#107838 - Unify validity checks into a single query rust-lang/rust#108364 - s/eval_usize/eval_target_usize/ for clarity rust-lang/rust#108029 - Use target instead of machine for mir interpreter integer handling rust-lang/rust#108047 - Switch to EarlyBinder for type_of query rust-lang/rust#107753 - Rename interner funcs rust-lang/rust#108250 - Optimize mk_region rust-lang/rust#108020 - Clarify iterator interners rust-lang/rust#108112
- Remove some superfluous type parameters from layout.rs rust-lang/rust#107163 - Introduce -Zterminal-urls to use OSC8 for error codes rust-lang/rust#107838 - Unify validity checks into a single query rust-lang/rust#108364 - s/eval_usize/eval_target_usize/ for clarity rust-lang/rust#108029 - Use target instead of machine for mir interpreter integer handling rust-lang/rust#108047 - Switch to EarlyBinder for type_of query rust-lang/rust#107753 - Rename interner funcs rust-lang/rust#108250 - Optimize mk_region rust-lang/rust#108020 - Clarify iterator interners rust-lang/rust#108112
Upstream PRs that require local changes: - Switch to EarlyBinder for type_of query rust-lang/rust#107753 - Factor query arena allocation out from query caches rust-lang/rust#107833 Co-authored-by: Qinheping Hu <qinhh@amazon.com>
… r=BoxyUwU Make `(try_)subst_and_normalize_erasing_regions` take `EarlyBinder` Changes `subst_and_normalize_erasing_regions` and `try_subst_and_normalize_erasing_regions` to take `EarlyBinder<T>` instead of `T`. (related to rust-lang#105779) This was suggested by `@BoxyUwU` in rust-lang#107753 (comment). After changing `type_of` to return `EarlyBinder`, there were several places where the binder was immediately skipped to call `tcx.subst_and_normalize_erasing_regions`, only for the binder to be reconstructed inside of that method. r? `@BoxyUwU`
This requires fixing some nightly APIs that have been changed in the latest nightly compiler. For reference, the PR in rustc for the API change in rustc crate: rust-lang/rust#107753 The tracking issue for the 'drain_filter' which is renamed to 'extract_if': rust-lang/rust#43244 Signed-off-by: Mukilan Thiyagarajan <mukilan@igalia.com>
This requires fixing some nightly APIs that have been changed in the latest nightly compiler. For reference, the PR in rustc for the API change in rustc crate: rust-lang/rust#107753 The tracking issue for the 'drain_filter' which is renamed to 'extract_if': rust-lang/rust#43244 Fixes servo#29467 Signed-off-by: Mukilan Thiyagarajan <mukilan@igalia.com>
This requires fixing some nightly APIs that have been changed in the latest nightly compiler. For reference, the PR in rustc for the API change in rustc crate: rust-lang/rust#107753 The tracking issue for the 'drain_filter' which is renamed to 'extract_if': rust-lang/rust#43244 Fixes servo#29467 Signed-off-by: Mukilan Thiyagarajan <mukilan@igalia.com>
This requires fixing some nightly APIs that have been changed in the latest nightly compiler. For reference, the PR in rustc for the API change in rustc crate: rust-lang/rust#107753 The tracking issue for the 'drain_filter' which is renamed to 'extract_if': rust-lang/rust#43244 Fixes servo#29467 Signed-off-by: Mukilan Thiyagarajan <mukilan@igalia.com>
Part of the work to finish #105779 and implement rust-lang/types-team#78.
Several queries
X
have abound_X
variant that wraps the output inEarlyBinder
. This addsEarlyBinder
to the return type of thetype_of
query and removesbound_type_of
.r? @lcnr