about summary refs log tree commit diff
path: root/src/rustllvm/RustWrapper.cpp
diff options
context:
space:
mode:
authorMark Rousskov <mark.simulacrum@gmail.com>2018-06-08 17:21:07 -0600
committerGitHub <noreply@github.com>2018-06-08 17:21:07 -0600
commit8ac351c2091973a4b7ce3c0428569bf5486e9a72 (patch)
treeb74bea9ae3d0d3ac9efaebfa5db7c52ee19bade6 /src/rustllvm/RustWrapper.cpp
parent898bb78024e618f43375564bf59655acdd7ddbc3 (diff)
parentb0440d359b0dab992e8f01d63523799a72c81285 (diff)
downloadrust-8ac351c2091973a4b7ce3c0428569bf5486e9a72.tar.gz
rust-8ac351c2091973a4b7ce3c0428569bf5486e9a72.zip
Rollup merge of #51412 - nnethercote:pending_obligations, r=estebank
Avoid useless Vec clones in pending_obligations().

The only instance of `ObligationForest` in use has an obligation type of
`PendingPredicateObligation`, which contains a `PredicateObligation` and a
`Vec<Ty>`.

`FulfillmentContext::pending_obligations()` calls
`ObligationForest::pending_obligations()`, which clones all the
`PendingPredicateObligation`s. But the `Vec<Ty>` field of those cloned
obligations is never touched.

This patch changes `ObligationForest::pending_obligations()` to
`map_pending_obligations` -- which gives callers control about which part
of the obligation to clone -- and takes advantage of the change to avoid
cloning the `Vec<Ty>`. The change speeds up runs of a few rustc-perf
benchmarks, the best by 1%.
Diffstat (limited to 'src/rustllvm/RustWrapper.cpp')
0 files changed, 0 insertions, 0 deletions