diff options
| author | Aaron Hill <aa1ronham@gmail.com> | 2018-08-02 14:58:13 -0400 |
|---|---|---|
| committer | Aaron Hill <aa1ronham@gmail.com> | 2018-08-02 14:58:13 -0400 |
| commit | b010d1f9295821f2f37de76a84ea4e26620456dd (patch) | |
| tree | aee1fa8923814fc9703c71088492c7ff073d69c7 | |
| parent | 016b5866852e3d9c7c5ba6cdc3938afe7976af9e (diff) | |
| download | rust-b010d1f9295821f2f37de76a84ea4e26620456dd.tar.gz rust-b010d1f9295821f2f37de76a84ea4e26620456dd.zip | |
Tidy fixes
| -rw-r--r-- | src/librustc/traits/auto_trait.rs | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/src/librustc/traits/auto_trait.rs b/src/librustc/traits/auto_trait.rs index ea96bd86f92..cfe3583a980 100644 --- a/src/librustc/traits/auto_trait.rs +++ b/src/librustc/traits/auto_trait.rs @@ -358,7 +358,8 @@ impl<'a, 'tcx> AutoTraitFinder<'a, 'tcx> { &Err(SelectionError::Unimplemented) => { if self.is_of_param(pred.skip_binder().trait_ref.substs) { already_visited.remove(&pred); - self.add_user_pred(&mut user_computed_preds, ty::Predicate::Trait(pred.clone())); + self.add_user_pred(&mut user_computed_preds, + ty::Predicate::Trait(pred.clone())); predicates.push_back(pred); } else { debug!( @@ -416,7 +417,8 @@ impl<'a, 'tcx> AutoTraitFinder<'a, 'tcx> { // under which a type implements an auto trait. A trait predicate involving // a HRTB means that the type needs to work with any choice of lifetime, // not just one specific lifetime (e.g. 'static). - fn add_user_pred<'c>(&self, user_computed_preds: &mut FxHashSet<ty::Predicate<'c>>, new_pred: ty::Predicate<'c>) { + fn add_user_pred<'c>(&self, user_computed_preds: &mut FxHashSet<ty::Predicate<'c>>, + new_pred: ty::Predicate<'c>) { let mut should_add_new = true; user_computed_preds.retain(|&old_pred| { match (&new_pred, old_pred) { @@ -430,11 +432,17 @@ impl<'a, 'tcx> AutoTraitFinder<'a, 'tcx> { return true } - for (new_region, old_region) in new_substs.regions().zip(old_substs.regions()) { + for (new_region, old_region) in new_substs + .regions() + .zip(old_substs.regions()) { + match (new_region, old_region) { // If both predicates have an 'ReLateBound' (a HRTB) in the // same spot, we do nothing - (ty::RegionKind::ReLateBound(_, _), ty::RegionKind::ReLateBound(_, _)) => {}, + ( + ty::RegionKind::ReLateBound(_, _), + ty::RegionKind::ReLateBound(_, _) + ) => {}, (ty::RegionKind::ReLateBound(_, _), _) => { // The new predicate has a HRTB in a spot where the old |
