clear out projection subobligations after they are processed#43999
clear out projection subobligations after they are processed#43999bors merged 1 commit intorust-lang:masterfrom
Conversation
src/librustc/traits/project.rs
Outdated
nikomatsakis
left a comment
There was a problem hiding this comment.
This makes a lot of sense. Have you measured the impact on performance?
src/librustc/traits/fulfill.rs
Outdated
There was a problem hiding this comment.
This would basically be when the obligation forest decides we are done with a projection predicate, right? In other words, the FIXME is sort of in the wrong place? I would expect us to iterate over outcome.completed (elsewhere in fulfill.rs...) and invoke complete() from there.
|
@arielb1 should this be nominated for a backport? |
|
@alexcrichton I think that @arielb1 backed out the relevant code for beta, so this applies to nightly only. |
After a projection was processed, its derived subobligations no longer need any processing when encountered, and can be removed. This improves the status of rust-lang#43787. This is actually complementary to rust-lang#43938 - that PR fixes selection caching (and @remram44's example, which "accidentally" worked because of the buggy projection caching) while this PR fixes projection caching
962ffb2 to
7534f73
Compare
|
Added comments. |
This allows caching closure signatures and kinds in the normal selection and evaluation caches, and fixes the exponential worst-case in @remram44's example, which is a part of rust-lang#43787. This improvement is complenentary to rust-lang#43999 - they fix different cases.
nikomatsakis
left a comment
There was a problem hiding this comment.
Nice comments. r=me.
|
@bors r+ |
|
📌 Commit 7534f73 has been approved by |
clear out projection subobligations after they are processed After a projection was processed, its derived subobligations no longer need any processing when encountered, and can be removed. This improves the status of #43787. This is actually complementary to #43938 - that PR fixes selection caching (and @remram44's example, which "accidentally" worked because of the buggy projection caching) while this PR fixes projection caching. r? @nikomatsakis
|
☀️ Test successful - status-appveyor, status-travis |
|
beta-nominating for 1.21 |
This allows caching closure signatures and kinds in the normal selection and evaluation caches, and fixes the exponential worst-case in @remram44's example, which is a part of rust-lang#43787. This improvement is complenentary to rust-lang#43999 - they fix different cases.
[beta] Track closure signatures & kinds in freshened types This allows caching closure signatures and kinds in the normal selection and evaluation caches, and fixes the exponential worst-case in @remram44's example, which is a part of #43787. This improvement is complenentary to #43999 - they fix different cases. This is the pre-generators variation of #43938, cloned for beta.
|
Marking as beta-accepted. Medium patch, but important. cc @rust-lang/compiler |
|
Backporting now. |
Beta 20170928 Backports of: - Allow unused extern crate again #44825 - macros: fix bug in collecting trait and impl items with derives. #44757 - `--cap-lints allow` switches off `can_emit_warnings` #44627 - Update the libc submodule #44116 - limit and clear cache obligations opportunistically #44269 - clear out projection subobligations after they are processed #43999
Beta 20170928 Backports of: - Allow unused extern crate again #44825 - macros: fix bug in collecting trait and impl items with derives. #44757 - `--cap-lints allow` switches off `can_emit_warnings` #44627 - Update the libc submodule #44116 - limit and clear cache obligations opportunistically #44269 - clear out projection subobligations after they are processed #43999 - fix logic error in #44269's `prune_cache_value_obligations` #45065 - REVERTS #43543: Cleanup some remains of `hr_lifetime_in_assoc_type` compatibility lint:
After a projection was processed, its derived subobligations no longer
need any processing when encountered, and can be removed. This improves
the status of #43787.
This is actually complementary to #43938 - that PR fixes selection
caching (and @remram44's example, which "accidentally" worked because of
the buggy projection caching) while this PR fixes projection caching.
r? @nikomatsakis