diff options
| author | bors <bors@rust-lang.org> | 2018-08-20 15:47:39 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2018-08-20 15:47:39 +0000 |
| commit | 1558ae7cfd5e1190d3388dcc6f0f734589e4e478 (patch) | |
| tree | e5052cf7aa779cc0cd67d31c8723a0fd88ce5ff1 /src/librustc_save_analysis | |
| parent | bf1e461173e3936e4014cc951dfbdd7d9ec9190b (diff) | |
| parent | ee9bd0fd99ef5049f53b5d8233369187637cb71c (diff) | |
| download | rust-1558ae7cfd5e1190d3388dcc6f0f734589e4e478.tar.gz rust-1558ae7cfd5e1190d3388dcc6f0f734589e4e478.zip | |
Auto merge of #51880 - varkor:generics-hir-generalisation-followup, r=eddyb
The Great Generics Generalisation: HIR Followup Addresses the final comments in #48149. r? @eddyb, but there are a few things I have yet to clean up. Making the PR now to more easily see when things break. cc @yodaldevoid
Diffstat (limited to 'src/librustc_save_analysis')
| -rw-r--r-- | src/librustc_save_analysis/dump_visitor.rs | 42 |
1 files changed, 24 insertions, 18 deletions
diff --git a/src/librustc_save_analysis/dump_visitor.rs b/src/librustc_save_analysis/dump_visitor.rs index c6cec2ecca6..dc9310cdcda 100644 --- a/src/librustc_save_analysis/dump_visitor.rs +++ b/src/librustc_save_analysis/dump_visitor.rs @@ -824,10 +824,12 @@ impl<'l, 'tcx: 'l, 'll, O: DumpOutput + 'll> DumpVisitor<'l, 'tcx, 'll, O> { if let Some(ref generic_args) = seg.args { match **generic_args { ast::GenericArgs::AngleBracketed(ref data) => { - data.args.iter().for_each(|arg| match arg { - ast::GenericArg::Type(ty) => self.visit_ty(ty), - _ => {} - }); + for arg in &data.args { + match arg { + ast::GenericArg::Type(ty) => self.visit_ty(ty), + _ => {} + } + } } ast::GenericArgs::Parenthesized(ref data) => { for t in &data.inputs { @@ -911,10 +913,12 @@ impl<'l, 'tcx: 'l, 'll, O: DumpOutput + 'll> DumpVisitor<'l, 'tcx, 'll, O> { // Explicit types in the turbo-fish. if let Some(ref generic_args) = seg.args { if let ast::GenericArgs::AngleBracketed(ref data) = **generic_args { - data.args.iter().for_each(|arg| match arg { - ast::GenericArg::Type(ty) => self.visit_ty(ty), - _ => {} - }); + for arg in &data.args { + match arg { + ast::GenericArg::Type(ty) => self.visit_ty(ty), + _ => {} + } + } } } @@ -1522,19 +1526,21 @@ impl<'l, 'tcx: 'l, 'll, O: DumpOutput + 'll> Visitor<'l> for DumpVisitor<'l, 'tc } fn visit_generics(&mut self, generics: &'l ast::Generics) { - generics.params.iter().for_each(|param| match param.kind { - ast::GenericParamKind::Lifetime { .. } => {} - ast::GenericParamKind::Type { ref default, .. } => { - for bound in ¶m.bounds { - if let ast::GenericBound::Trait(ref trait_ref, _) = *bound { - self.process_path(trait_ref.trait_ref.ref_id, &trait_ref.trait_ref.path) + for param in &generics.params { + match param.kind { + ast::GenericParamKind::Lifetime { .. } => {} + ast::GenericParamKind::Type { ref default, .. } => { + for bound in ¶m.bounds { + if let ast::GenericBound::Trait(ref trait_ref, _) = *bound { + self.process_path(trait_ref.trait_ref.ref_id, &trait_ref.trait_ref.path) + } + } + if let Some(ref ty) = default { + self.visit_ty(&ty); } - } - if let Some(ref ty) = default { - self.visit_ty(&ty); } } - }); + } } fn visit_ty(&mut self, t: &'l ast::Ty) { |
