Use iterators instead of slices at more sites
This commit is contained in:
parent
ec8d01fdcc
commit
9e4c3f41c1
@ -316,7 +316,7 @@ fn visit_implementation_of_dispatch_from_dyn<'tcx>(tcx: TyCtxt<'tcx>, impl_did:
|
||||
dispatch_from_dyn_trait,
|
||||
0,
|
||||
field.ty(tcx, substs_a),
|
||||
&[field.ty(tcx, substs_b).into()],
|
||||
[field.ty(tcx, substs_b).into()],
|
||||
)
|
||||
}),
|
||||
);
|
||||
@ -558,7 +558,7 @@ pub fn coerce_unsized_info<'tcx>(tcx: TyCtxt<'tcx>, impl_did: DefId) -> CoerceUn
|
||||
// Register an obligation for `A: Trait<B>`.
|
||||
let cause = traits::ObligationCause::misc(span, impl_hir_id);
|
||||
let predicate =
|
||||
predicate_for_trait_def(tcx, param_env, cause, trait_def_id, 0, source, &[target.into()]);
|
||||
predicate_for_trait_def(tcx, param_env, cause, trait_def_id, 0, source, [target.into()]);
|
||||
let errors = traits::fully_solve_obligation(&infcx, predicate);
|
||||
if !errors.is_empty() {
|
||||
infcx.err_ctxt().report_fulfillment_errors(&errors, None);
|
||||
|
@ -631,7 +631,7 @@ impl<'f, 'tcx> Coerce<'f, 'tcx> {
|
||||
coerce_unsized_did,
|
||||
0,
|
||||
coerce_source,
|
||||
&[coerce_target.into()]
|
||||
[coerce_target.into()]
|
||||
)];
|
||||
|
||||
let mut has_unsized_tuple_coercion = false;
|
||||
|
@ -241,7 +241,7 @@ impl<'tcx> ConstToPat<'tcx> {
|
||||
partial_eq_trait_id,
|
||||
0,
|
||||
ty,
|
||||
&[any_ty],
|
||||
[any_ty],
|
||||
);
|
||||
// FIXME: should this call a `predicate_must_hold` variant instead?
|
||||
|
||||
|
@ -11,6 +11,7 @@
|
||||
//! This API is completely unstable and subject to change.
|
||||
|
||||
#![doc(html_root_url = "https://doc.rust-lang.org/nightly/nightly-rustc/")]
|
||||
#![feature(associated_type_bounds)]
|
||||
#![feature(box_patterns)]
|
||||
#![feature(control_flow_enum)]
|
||||
#![feature(drain_filter)]
|
||||
|
@ -1108,7 +1108,7 @@ impl<'cx, 'tcx> SelectionContext<'cx, 'tcx> {
|
||||
obligation.predicate.def_id(),
|
||||
obligation.recursion_depth + 1,
|
||||
source_tail,
|
||||
&[target_tail.into()],
|
||||
[target_tail.into()],
|
||||
));
|
||||
}
|
||||
|
||||
@ -1139,7 +1139,7 @@ impl<'cx, 'tcx> SelectionContext<'cx, 'tcx> {
|
||||
obligation.predicate.def_id(),
|
||||
obligation.recursion_depth + 1,
|
||||
a_last,
|
||||
&[b_last.into()],
|
||||
[b_last.into()],
|
||||
)
|
||||
}));
|
||||
}
|
||||
|
@ -2101,7 +2101,7 @@ impl<'cx, 'tcx> SelectionContext<'cx, 'tcx> {
|
||||
trait_def_id,
|
||||
recursion_depth,
|
||||
normalized_ty,
|
||||
&[],
|
||||
[],
|
||||
);
|
||||
obligations.push(placeholder_obligation);
|
||||
obligations
|
||||
|
@ -239,9 +239,9 @@ pub fn predicate_for_trait_def<'tcx>(
|
||||
trait_def_id: DefId,
|
||||
recursion_depth: usize,
|
||||
self_ty: Ty<'tcx>,
|
||||
params: &[GenericArg<'tcx>],
|
||||
params: impl IntoIterator<Item = GenericArg<'tcx>, IntoIter: ExactSizeIterator>,
|
||||
) -> PredicateObligation<'tcx> {
|
||||
let trait_ref = tcx.mk_trait_ref(trait_def_id, self_ty, params.iter().copied());
|
||||
let trait_ref = tcx.mk_trait_ref(trait_def_id, self_ty, params);
|
||||
predicate_for_trait_ref(tcx, cause, param_env, trait_ref, recursion_depth)
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user