about summary refs log tree commit diff
path: root/src/liballoc/string.rs
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2018-03-13 15:24:45 +0000
committerbors <bors@rust-lang.org>2018-03-13 15:24:45 +0000
commit8c4ff22a2d745097197c659ef9e3b04b8ceeb070 (patch)
tree61da4bce1ccb69b9b35362a967ba2db8a58e1dd0 /src/liballoc/string.rs
parente65547d4fad0425d1db4f33a4d8134bf2cad939e (diff)
parent17c4103f3f0cc8bd4dea9de5e7ef155daf363cfe (diff)
downloadrust-8c4ff22a2d745097197c659ef9e3b04b8ceeb070.tar.gz
rust-8c4ff22a2d745097197c659ef9e3b04b8ceeb070.zip
Auto merge of #48411 - nikomatsakis:chalkify-canonical-query-mir, r=eddyb
introduce canonical queries, use for normalization and dropck-outlives

This branch adds in the concept of a **canonicalized trait query** and uses it for three specific operations:

- `infcx.at(cause, param_env).normalize(type_foldable)`
    - normalizes all associated types in `type_foldable`
- `tcx.normalize_erasing_regions(param_env, type_foldable)`
    - like normalize, but erases regions first and in the result; this leads to better caching
- `infcx.at(cause, param_env).dropck_outlives(ty)`
    - produces the set of types that must be live when a value of type `ty` is dropped
    - used from dropck but also NLL outlives

This is a kind of "first step" towards a more Chalk-ified approach. It leads to a **big** speedup for NLL, which is basically dominated by the dropck-outlives computation. Here are some timing measurements for the `syn` crate (pre-branch measurements coming soon):

| Commit | NLL disabled | NLL enabled |
| ------- | --- | --- |
| Before my branch | 5.43s | 8.99s |
| After my branch | 5.36s | 7.25s |

(Note that NLL enabled still does *all the work* that NLL disabled does, so this is not really a way to compare the performance of NLL versus the AST-based borrow checker directly.) Since this affects all codepaths, I'd like to do a full perf run before we land anything.

Also, this is not the "final point" for canonicalization etc. I think canonicalization can be made substantially faster, for one thing. But it seems like a reasonable starting point for a branch that's gotten a bit larger than I would have liked.

**Commit convention:** First of all, this entire branch ought to be a "pure refactoring", I believe, not changing anything about external behavior. Second, I've tagged the most important commits with `[VIC]` (very important commit), so you can scan for those. =)

r? @eddyb
Diffstat (limited to 'src/liballoc/string.rs')
0 files changed, 0 insertions, 0 deletions