Repository navigation
trait_selection: Restore type-op solver constraints - #163936
Dnreikronos wants to merge 1 commit into
Conversation
|
Some changes occurred to the core trait solver cc @rust-lang/initiative-trait-system-refactor |
|
@bors try @rust-timer queue |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
…onstraints, r=<try> trait_selection: Restore type-op solver constraints
This comment has been minimized.
This comment has been minimized.
|
Finished benchmarking commit (081f5df): comparison URL. Overall result: ❌ regressions - please read:Benchmarking means the PR may be perf-sensitive. It's automatically marked not fit for rolling up. Overriding is possible but disadvised: it risks changing compiler perf. Next, please: If you can, justify the regressions found in this try perf run in writing along with @bors rollup=never rustc-perf Instruction countOur most reliable metric. Used to determine the overall result above. However, even this metric can be noisy.
Max RSS (memory usage)Results (primary 2.1%, secondary 2.6%)A less reliable metric. May be of interest, but not used to determine the overall result above.
CyclesResults (secondary 4.3%)A less reliable metric. May be of interest, but not used to determine the overall result above.
Binary sizeThis perf run didn't have relevant results for this metric. Bootstrap: 489.893s -> 488.402s (-0.30%) |
|
that is significantly better than last time :3 though still subopties |
Bringing back #161423 after @BoxyUwU suggested checking perf again now that Khy's lazy constraint storage from #162531 has landed. The original fix was reverted because of the performance regression.
With assumptions on binders enabled, proving a predicate or normalizing a type can produce solver region constraints inside a canonical query. Those constraints weren't included in the response, so they disappeared when the query's inference context went away. Borrowck could then accept a body with a missing lifetime bound, as in
borrowck_env_fail.The solver constraints now travel in
QueryRegionConstraintsand get instantiated along with the rest of the response.scrape_region_constraintsalso drains constraints from completed operations into that same result. Borrowck collects them and lowers them once the body's bounds are available. Constraints from normalizing implied bounds also reach lexical regionck. The cached constraints have no spans, so each caller supplies its own.I think keeping the constraints in the query response is the right place for this. It keeps the existing query cache and fast paths working, and gives the constraints the same route back to the caller as the other query results. The payload stays optional, so we don't allocate an empty solver constraint tree when AoB is off. I still want a fresh perf run before landing it, since avoiding those allocations alone doesn't tell us what the overall cost is.
The compiler check passed locally, along with the alias-outlives regression, the pass test in default, next-solver and AoB modes, and the three solver-constraint unit tests. Tidy and formatting checks passed too.
r? @BoxyUwU