Skip to content

Commit 85bbd7d

Browse files
author
Markus Westerlind
committed
perf: Avoid allocating a new Vec on each stall
1 parent b9a94c9 commit 85bbd7d

File tree

1 file changed

+3
-3
lines changed
  • compiler/rustc_trait_selection/src/traits

1 file changed

+3
-3
lines changed

compiler/rustc_trait_selection/src/traits/fulfill.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -678,10 +678,10 @@ impl<'a, 'b, 'tcx> FulfillProcessor<'a, 'b, 'tcx> {
678678
}
679679

680680
/// Returns the set of inference variables contained in a trait ref.
681-
fn trait_ref_infer_vars<'a, 'tcx>(
682-
selcx: &mut SelectionContext<'a, 'tcx>,
681+
fn trait_ref_infer_vars<'a, 'tcx, 'b>(
682+
selcx: &'b mut SelectionContext<'a, 'tcx>,
683683
trait_ref: ty::PolyTraitRef<'tcx>,
684-
) -> Vec<TyOrConstInferVar<'tcx>> {
684+
) -> impl Iterator<Item = TyOrConstInferVar<'tcx>> + 'b + Captures<'a> + Captures<'tcx> {
685685
selcx
686686
.infcx()
687687
.resolve_vars_if_possible(&trait_ref)

0 commit comments

Comments
 (0)