diff options
| author | Michael Goulet <michael@errs.io> | 2023-07-25 23:31:21 +0000 |
|---|---|---|
| committer | Michael Goulet <michael@errs.io> | 2023-08-01 23:19:31 +0000 |
| commit | 99969d282bd853442d7539b83833816b73e642e1 (patch) | |
| tree | bbf1b4584ccfa75fe855fb6fc569437e1e834791 /compiler/rustc_trait_selection/src | |
| parent | d12c6e947ceacf3b22c154caf9532b390d8dc88a (diff) | |
| download | rust-99969d282bd853442d7539b83833816b73e642e1.tar.gz rust-99969d282bd853442d7539b83833816b73e642e1.zip | |
Use upvar_tys in more places, make it a list
Diffstat (limited to 'compiler/rustc_trait_selection/src')
| -rw-r--r-- | compiler/rustc_trait_selection/src/traits/query/dropck_outlives.rs | 6 | ||||
| -rw-r--r-- | compiler/rustc_trait_selection/src/traits/select/mod.rs | 5 |
2 files changed, 6 insertions, 5 deletions
diff --git a/compiler/rustc_trait_selection/src/traits/query/dropck_outlives.rs b/compiler/rustc_trait_selection/src/traits/query/dropck_outlives.rs index ef989d8c9d6..9484a50e3a9 100644 --- a/compiler/rustc_trait_selection/src/traits/query/dropck_outlives.rs +++ b/compiler/rustc_trait_selection/src/traits/query/dropck_outlives.rs @@ -291,9 +291,9 @@ pub fn dtorck_constraint_for_ty_inner<'tcx>( return Err(NoSolution); } - constraints.outlives.extend( - args.as_generator().upvar_tys().map(|t| -> ty::GenericArg<'tcx> { t.into() }), - ); + constraints + .outlives + .extend(args.as_generator().upvar_tys().iter().map(ty::GenericArg::from)); constraints.outlives.push(args.as_generator().resume_ty().into()); } diff --git a/compiler/rustc_trait_selection/src/traits/select/mod.rs b/compiler/rustc_trait_selection/src/traits/select/mod.rs index c29696bc817..1f3cea351bb 100644 --- a/compiler/rustc_trait_selection/src/traits/select/mod.rs +++ b/compiler/rustc_trait_selection/src/traits/select/mod.rs @@ -2169,7 +2169,8 @@ impl<'tcx> SelectionContext<'_, 'tcx> { let all = args .as_generator() .upvar_tys() - .chain(iter::once(args.as_generator().witness())) + .iter() + .chain([args.as_generator().witness()]) .collect::<Vec<_>>(); Where(obligation.predicate.rebind(all)) } @@ -2210,7 +2211,7 @@ impl<'tcx> SelectionContext<'_, 'tcx> { // Not yet resolved. Ambiguous } else { - Where(obligation.predicate.rebind(args.as_closure().upvar_tys().collect())) + Where(obligation.predicate.rebind(args.as_closure().upvar_tys().to_vec())) } } |
