Skip to content

Commit 78c178b

Browse files
committed
traits/fulfill: add a couple FIXME comments about potential optimizations.
1 parent 40f73e7 commit 78c178b

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/librustc_trait_selection/traits/fulfill.rs

+5
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,9 @@ pub struct FulfillmentContext<'tcx> {
7373
#[derive(Clone, Debug)]
7474
pub struct PendingPredicateObligation<'tcx> {
7575
pub obligation: PredicateObligation<'tcx>,
76+
// FIXME(eddyb) look into whether this could be a `SmallVec`.
77+
// Judging by the comment in `process_obligation`, the 1-element case
78+
// is common so this could be a `SmallVec<[TyOrConstInferVar<'tcx>; 1]>`.
7679
pub stalled_on: Vec<TyOrConstInferVar<'tcx>>,
7780
}
7881

@@ -538,6 +541,8 @@ fn trait_ref_type_vars<'a, 'tcx>(
538541
// FIXME(eddyb) walk over `GenericArg` to support const infer vars.
539542
.input_types()
540543
.map(|ty| selcx.infcx().resolve_vars_if_possible(&ty))
544+
// FIXME(eddyb) try using `maybe_walk` to skip *all* subtrees that
545+
// don't contain inference variables, not just the outermost level.
541546
// FIXME(eddyb) use `has_infer_types_or_const`.
542547
.filter(|ty| ty.has_infer_types())
543548
.flat_map(|ty| ty.walk())

0 commit comments

Comments
 (0)