1
Fork 0
rust/compiler/rustc_trait_selection/src
bors 9618da7c99 Auto merge of #131422 - GnomedDev:smallvec-predicate-obligations, r=compiler-errors
Use `ThinVec` for PredicateObligation storage

~~I noticed while profiling clippy on a project that a large amount of time is being spent allocating `Vec`s for `PredicateObligation`, and the `Vec`s are often quite small. This is an attempt to optimise this by using SmallVec to avoid heap allocations for these common small Vecs.~~

This PR turns all the `Vec<PredicateObligation>` into a single type alias while avoiding referring to `Vec` around it, then swaps the type over to `ThinVec<PredicateObligation>` and fixes the fallout. This also contains an implementation of `ThinVec::extract_if`, copied from `Vec::extract_if` and currently being upstreamed to https://github.com/Gankra/thin-vec/pull/66.

This leads to a small (0.2-0.7%) performance gain in the latest perf run.
2024-10-16 04:06:14 +00:00
..
error_reporting Auto merge of #131422 - GnomedDev:smallvec-predicate-obligations, r=compiler-errors 2024-10-16 04:06:14 +00:00
errors Reformat using the new identifier sorting from rustfmt 2024-09-22 19:11:29 -04:00
solve Swap PredicateObligation to ThinVec 2024-10-12 15:17:16 +01:00
traits Auto merge of #131422 - GnomedDev:smallvec-predicate-obligations, r=compiler-errors 2024-10-16 04:06:14 +00:00
errors.rs Reformat using the new identifier sorting from rustfmt 2024-09-22 19:11:29 -04:00
infer.rs Remove #[macro_use] extern crate tracing from rustc_trait_selection. 2024-08-30 17:14:59 +10:00
lib.rs Stabilize the map/value methods on ControlFlow 2024-09-25 19:00:17 -07:00
regions.rs Reformat using the new identifier sorting from rustfmt 2024-09-22 19:11:29 -04:00
solve.rs impossible obligations check fast path 2024-10-10 06:09:50 -04:00