diff options
| author | Eduard-Mihai Burtescu <edy.burt@gmail.com> | 2020-03-21 09:57:30 +0200 |
|---|---|---|
| committer | Eduard-Mihai Burtescu <edy.burt@gmail.com> | 2020-03-21 09:57:35 +0200 |
| commit | 78c178bcda3589affb0f4ffa248398cfca08c98f (patch) | |
| tree | 63682bffc1b734d4291f0258f3edba23dfd46feb /src | |
| parent | 40f73e74d3d84a1f0ae89a933fa31078850a1b20 (diff) | |
| download | rust-78c178bcda3589affb0f4ffa248398cfca08c98f.tar.gz rust-78c178bcda3589affb0f4ffa248398cfca08c98f.zip | |
traits/fulfill: add a couple FIXME comments about potential optimizations.
Diffstat (limited to 'src')
| -rw-r--r-- | src/librustc_trait_selection/traits/fulfill.rs | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/librustc_trait_selection/traits/fulfill.rs b/src/librustc_trait_selection/traits/fulfill.rs index 559718fca54..9eddeba50c1 100644 --- a/src/librustc_trait_selection/traits/fulfill.rs +++ b/src/librustc_trait_selection/traits/fulfill.rs @@ -73,6 +73,9 @@ 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]>`. pub stalled_on: Vec<TyOrConstInferVar<'tcx>>, } @@ -538,6 +541,8 @@ fn trait_ref_type_vars<'a, 'tcx>( // FIXME(eddyb) walk over `GenericArg` to support const infer vars. .input_types() .map(|ty| selcx.infcx().resolve_vars_if_possible(&ty)) + // FIXME(eddyb) try using `maybe_walk` to skip *all* subtrees that + // don't contain inference variables, not just the outermost level. // FIXME(eddyb) use `has_infer_types_or_const`. .filter(|ty| ty.has_infer_types()) .flat_map(|ty| ty.walk()) |
