diff options
| author | Andrew Cann <shum@canndrew.org> | 2022-03-21 12:57:06 +0800 |
|---|---|---|
| committer | Charles Lew <crlf0710@gmail.com> | 2022-09-11 14:04:16 +0800 |
| commit | 22f4bbb20f373b0c3d47788f58c95d60656918f2 (patch) | |
| tree | 478ff4f6dae1a7afb05ce002c71bbb5bb1fd1dca /compiler/rustc_trait_selection/src | |
| parent | 8aa30dd3cb18e4e6a1a5940addd8e744ab8d3eef (diff) | |
| download | rust-22f4bbb20f373b0c3d47788f58c95d60656918f2.tar.gz rust-22f4bbb20f373b0c3d47788f58c95d60656918f2.zip | |
Apply formatting fixes
Diffstat (limited to 'compiler/rustc_trait_selection/src')
| -rw-r--r-- | compiler/rustc_trait_selection/src/traits/select/mod.rs | 25 |
1 files changed, 17 insertions, 8 deletions
diff --git a/compiler/rustc_trait_selection/src/traits/select/mod.rs b/compiler/rustc_trait_selection/src/traits/select/mod.rs index 3499c64a1db..b5e7a8b562e 100644 --- a/compiler/rustc_trait_selection/src/traits/select/mod.rs +++ b/compiler/rustc_trait_selection/src/traits/select/mod.rs @@ -1939,11 +1939,13 @@ impl<'cx, 'tcx> SelectionContext<'cx, 'tcx> { ty::Generator(_, substs, hir::Movability::Movable) => { if self.tcx().features().generator_clone { - let resolved_upvars = self.infcx.shallow_resolve(substs.as_generator().tupled_upvars_ty()); - let resolved_witness = self.infcx.shallow_resolve(substs.as_generator().witness()); + let resolved_upvars = + self.infcx.shallow_resolve(substs.as_generator().tupled_upvars_ty()); + let resolved_witness = + self.infcx.shallow_resolve(substs.as_generator().witness()); if { - matches!(resolved_upvars.kind(), ty::Infer(ty::TyVar(_))) || - matches!(resolved_witness.kind(), ty::Infer(ty::TyVar(_))) + matches!(resolved_upvars.kind(), ty::Infer(ty::TyVar(_))) + || matches!(resolved_witness.kind(), ty::Infer(ty::TyVar(_))) } { // Not yet resolved. Ambiguous @@ -1967,14 +1969,21 @@ impl<'cx, 'tcx> SelectionContext<'cx, 'tcx> { if matches!(resolved.kind(), ty::Infer(ty::TyVar(_))) { break Ambiguous; } - }, + } Option::None => { // (*) binder moved here let all_vars = self.tcx().mk_bound_variable_kinds( - obligation.predicate.bound_vars().iter().chain(binder.bound_vars().iter()) + obligation + .predicate + .bound_vars() + .iter() + .chain(binder.bound_vars().iter()), ); - break Where(ty::Binder::bind_with_vars(witness_tys.to_vec(), all_vars)); - }, + break Where(ty::Binder::bind_with_vars( + witness_tys.to_vec(), + all_vars, + )); + } } } } |
