-
Notifications
You must be signed in to change notification settings - Fork 13k
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
obligations_for_self_ty
: use ProofTreeVisitor
for nested goals
#122385
Conversation
Some changes occurred to the core trait solver cc @rust-lang/initiative-trait-system-refactor |
@rustbot author since i think ur still working on this |
7754ca8
to
a5f7f1e
Compare
This comment has been minimized.
This comment has been minimized.
`super::super` of `rustc_hir_typeck::fn_ctxt::_impl` is just `rustc_hir_typeck`.
97c9abd
to
6a17037
Compare
c09ae21
to
7cf4574
Compare
uses a `ProofTreeVisitor` to look into nested goals when looking at the pending obligations during hir typeck. Used by closure signature inference, coercion, and for async functions.
7cf4574
to
03878c6
Compare
@bors try @rust-timer queue |
This comment has been minimized.
This comment has been minimized.
…r=<try> `obligations_for_self_ty`: use `ProofTreeVisitor` for nested goals As always, dealing with proof trees continues to be a hacked together mess. After this PR and rust-lang#124380 the only remaining blocker for core is rust-lang/trait-system-refactor-initiative#90. There is also a `ProofTreeVisitor` issue causing an ICE when compiling `alloc` which I will handle in a separate PR. This issue likely affects coherence diagnostics more generally. The core idea is to extend the proof tree visitor to support visiting nested candidates without using a `probe`. We then simply recurse into nested candidates if they are the only potentially applicable candidate for a given goal and check whether the self type matches the expected one. For that to work, we need to improve `CanonicalState` to also handle unconstrained inference variables created inside of the trait solver. This is done by extending the `var_values` of `CanoncalState` with each fresh inference variables. Furthermore, we also store the state of all inference variables at the end of each probe. When recursing into `InspectCandidates` we then unify the values of all these states. r? `@compiler-errors`
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.
thanks! this is great. r=me after perf is ready.
the try build in question: https://github.com/rust-lang-ci/rust/actions/runs/8838574745 |
|
@bors try @rust-timer queue |
This comment has been minimized.
This comment has been minimized.
…r=<try> `obligations_for_self_ty`: use `ProofTreeVisitor` for nested goals As always, dealing with proof trees continues to be a hacked together mess. After this PR and rust-lang#124380 the only remaining blocker for core is rust-lang/trait-system-refactor-initiative#90. There is also a `ProofTreeVisitor` issue causing an ICE when compiling `alloc` which I will handle in a separate PR. This issue likely affects coherence diagnostics more generally. The core idea is to extend the proof tree visitor to support visiting nested candidates without using a `probe`. We then simply recurse into nested candidates if they are the only potentially applicable candidate for a given goal and check whether the self type matches the expected one. For that to work, we need to improve `CanonicalState` to also handle unconstrained inference variables created inside of the trait solver. This is done by extending the `var_values` of `CanoncalState` with each fresh inference variables. Furthermore, we also store the state of all inference variables at the end of each probe. When recursing into `InspectCandidates` we then unify the values of all these states. r? `@compiler-errors`
☀️ Try build successful - checks-actions |
This comment has been minimized.
This comment has been minimized.
Finished benchmarking commit (9dcd6e5): comparison URL. Overall result: ✅ improvements - no action neededBenchmarking this pull request likely means that it is perf-sensitive, so we're automatically marking it as not fit for rolling up. While you can manually mark this PR as fit for rollup, we strongly recommend not doing so since this PR may lead to changes in compiler perf. @bors rollup=never 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)ResultsThis 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.
CyclesThis benchmark run did not return any relevant results for this metric. Binary sizeThis benchmark run did not return any relevant results for this metric. Bootstrap: 671.645s -> 672.204s (0.08%) |
@bors r+ |
☀️ Test successful - checks-actions |
Finished benchmarking commit (1b3a329): 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.
Binary sizeThis benchmark run did not return any relevant results for this metric. Bootstrap: 671.528s -> 671.828s (0.04%) |
…iler-errors Fix some triagebot mentions paths This fixes some mentions paths in `triagebot.toml` that are no longer valid. * rustdoc themes were merged into rustdoc.css (which already has a mention, and unfortunately can't independently mention the ayu theme). rust-lang#115829 cc `@GuillaumeGomez` `@Cldfire` * The entry for `inspect_obligations.rs` was never correct, from rust-lang#122385. cc `@lcnr` `@compiler-errors` * The entry for `need_type_info.rs` was moved in rust-lang#127501
Rollup merge of rust-lang#134045 - ehuss:triagebot-path-fixes, r=compiler-errors Fix some triagebot mentions paths This fixes some mentions paths in `triagebot.toml` that are no longer valid. * rustdoc themes were merged into rustdoc.css (which already has a mention, and unfortunately can't independently mention the ayu theme). rust-lang#115829 cc `@GuillaumeGomez` `@Cldfire` * The entry for `inspect_obligations.rs` was never correct, from rust-lang#122385. cc `@lcnr` `@compiler-errors` * The entry for `need_type_info.rs` was moved in rust-lang#127501
Fix some triagebot mentions paths This fixes some mentions paths in `triagebot.toml` that are no longer valid. * rustdoc themes were merged into rustdoc.css (which already has a mention, and unfortunately can't independently mention the ayu theme). rust-lang/rust#115829 cc `@GuillaumeGomez` `@Cldfire` * The entry for `inspect_obligations.rs` was never correct, from rust-lang/rust#122385. cc `@lcnr` `@compiler-errors` * The entry for `need_type_info.rs` was moved in rust-lang/rust#127501
As always, dealing with proof trees continues to be a hacked together mess. After this PR and #124380 the only remaining blocker for core is rust-lang/trait-system-refactor-initiative#90. There is also a
ProofTreeVisitor
issue causing an ICE when compilingalloc
which I will handle in a separate PR. This issue likely affects coherence diagnostics more generally.The core idea is to extend the proof tree visitor to support visiting nested candidates without using a
probe
. We then simply recurse into nested candidates if they are the only potentially applicable candidate for a given goal and check whether the self type matches the expected one.For that to work, we need to improve
CanonicalState
to also handle unconstrained inference variables created inside of the trait solver. This is done by extending thevar_values
ofCanoncalState
with each fresh inference variables. Furthermore, we also store the state of all inference variables at the end of each probe. When recursing intoInspectCandidates
we then unify the values of all these states.r? @compiler-errors