Rollup merge of #56742 - ljedrz:remove_query_response_box, r=oli-obk

infer: remove Box from a returned Iterator
This commit is contained in:
Mazdak Farrokhzad 2018-12-16 14:08:24 +01:00 committed by GitHub
commit af3f9072f5
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -36,6 +36,7 @@ use traits::{Obligation, ObligationCause, PredicateObligation};
use ty::fold::TypeFoldable;
use ty::subst::{Kind, UnpackedKind};
use ty::{self, BoundVar, Lift, Ty, TyCtxt};
use util::captures::Captures;
impl<'cx, 'gcx, 'tcx> InferCtxtBuilder<'cx, 'gcx, 'tcx> {
/// The "main method" for a canonicalized trait query. Given the
@ -527,8 +528,7 @@ impl<'cx, 'gcx, 'tcx> InferCtxt<'cx, 'gcx, 'tcx> {
param_env: ty::ParamEnv<'tcx>,
unsubstituted_region_constraints: &'a [QueryRegionConstraint<'tcx>],
result_subst: &'a CanonicalVarValues<'tcx>,
) -> impl Iterator<Item = PredicateObligation<'tcx>> + 'a {
Box::new(
) -> impl Iterator<Item = PredicateObligation<'tcx>> + 'a + Captures<'gcx> {
unsubstituted_region_constraints
.iter()
.map(move |constraint| {
@ -552,7 +552,6 @@ impl<'cx, 'gcx, 'tcx> InferCtxt<'cx, 'gcx, 'tcx> {
}
)
})
) as Box<dyn Iterator<Item = _>>
}
/// Given two sets of values for the same set of canonical variables, unify them.