-
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
Structurally normalize weak and inherent in new solver #114594
Structurally normalize weak and inherent in new solver #114594
Conversation
I thought I already had this included somewhere in some other PR, but I may have rebased it out by accident. Maybe I totally forgor and this is already up in some other PR. |
@bors r+ rollup (should only affect new solver) |
…iaskrgr Rollup of 7 pull requests Successful merges: - rust-lang#114376 (Avoid exporting __rust_alloc_error_handler_should_panic more than once.) - rust-lang#114413 (Warn when #[macro_export] is applied on decl macros) - rust-lang#114497 (Revert rust-lang#98333 "Re-enable atomic loads and stores for all RISC-V targets") - rust-lang#114500 (Remove arm crypto target feature) - rust-lang#114566 (Store the laziness of type aliases in their `DefKind`) - rust-lang#114594 (Structurally normalize weak and inherent in new solver) - rust-lang#114596 (Rename method in `opt-dist`) r? `@ghost` `@rustbot` modify labels: rollup
@@ -1012,6 +1012,10 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> { | |||
cause: Option<ObligationCause<'tcx>>, | |||
) -> RelateResult<'tcx, Ty<'tcx>> { | |||
let source = self.try_structurally_resolve_type(expr.span, expr_ty); | |||
let target = self.try_structurally_resolve_type( |
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.
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.
I’ll check if cachegrind has anything interesting to say
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.
I'm also just getting rid of this one line and running perf in #114648.
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.
If this is the culprit, I guess I may be able to work around it.
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.
Processing obligations seems to be the main source of change, but hopefully we'll learn more in the new PR if it's not some kind of noise.
260,711,737 ???:<rustc_data_structures::obligation_forest::ObligationForest<rustc_trait_selection::traits::fulfill::PendingPredicateObligation>>::process_obligations::<rustc_trait_selection::traits::fulfill::FulfillProcessor>
Only resolve target type in `try_coerce` in new solver Only needed in new solver, seems to affect perf in old solver. cc rust-lang#114604/rust-lang#114594
It seems pretty obvious to me that we should be normalizing weak and inherent aliases too, since they can always be normalized. This PR still leaves open the question of what to do with opaques, though 💀
Also, we need to structurally resolve the target of a coercion, for the UI test to work.
r? @lcnr