Skip to content

fulfill: try using SmallVec or Box for stalled_on #72776

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 1, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions src/librustc_trait_selection/traits/fulfill.rs
Original file line number Diff line number Diff line change
Expand Up @@ -75,9 +75,10 @@ pub struct FulfillmentContext<'tcx> {
#[derive(Clone, Debug)]
pub struct PendingPredicateObligation<'tcx> {
pub obligation: PredicateObligation<'tcx>,
// FIXME(eddyb) look into whether this could be a `SmallVec`.
// Judging by the comment in `process_obligation`, the 1-element case
// is common so this could be a `SmallVec<[TyOrConstInferVar<'tcx>; 1]>`.
// This is far more often read than modified, meaning that we
// should mostly optimize for reading speed, while modifying is not as relevant.
//
// For whatever reason using a boxed slice is slower than using a `Vec` here.
pub stalled_on: Vec<TyOrConstInferVar<'tcx>>,
}

Expand Down