about summary refs log tree commit diff
path: root/compiler/rustc_save_analysis/src/lib.rs
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2021-01-13 01:40:41 +0000
committerbors <bors@rust-lang.org>2021-01-13 01:40:41 +0000
commit150d1fee04856ff158e34e8d687a7fe59e97ef33 (patch)
treeff41418d95d6a5e8d493980c14fa249f59fc1099 /compiler/rustc_save_analysis/src/lib.rs
parent058a71016553f267ae80b90276ef79956457d51a (diff)
parenta8ff647deb102f4669025be3ba45ae2990ef0c08 (diff)
downloadrust-150d1fee04856ff158e34e8d687a7fe59e97ef33.tar.gz
rust-150d1fee04856ff158e34e8d687a7fe59e97ef33.zip
Auto merge of #79322 - jyn514:refactor-impl, r=estebank
Separate out a `hir::Impl` struct

This makes it possible to pass the `Impl` directly to functions, instead
of having to pass each of the many fields one at a time. It also
simplifies matches in many cases.

See `rustc_save_analysis::dump_visitor::process_impl` or `rustdoc::clean::clean_impl` for a good example of how this makes `impl`s easier to work with.

r? `@petrochenkov` maybe?
Diffstat (limited to 'compiler/rustc_save_analysis/src/lib.rs')
-rw-r--r--compiler/rustc_save_analysis/src/lib.rs4
1 files changed, 2 insertions, 2 deletions
diff --git a/compiler/rustc_save_analysis/src/lib.rs b/compiler/rustc_save_analysis/src/lib.rs
index 056c0b3d9d5..c8cdff4f7e5 100644
--- a/compiler/rustc_save_analysis/src/lib.rs
+++ b/compiler/rustc_save_analysis/src/lib.rs
@@ -318,7 +318,7 @@ impl<'tcx> SaveContext<'tcx> {
                     attributes: lower_attributes(item.attrs.to_vec(), self),
                 }))
             }
-            hir::ItemKind::Impl { ref of_trait, ref self_ty, ref items, .. } => {
+            hir::ItemKind::Impl(hir::Impl { ref of_trait, ref self_ty, ref items, .. }) => {
                 if let hir::TyKind::Path(hir::QPath::Resolved(_, ref path)) = self_ty.kind {
                     // Common case impl for a struct or something basic.
                     if generated_code(path.span) {
@@ -410,7 +410,7 @@ impl<'tcx> SaveContext<'tcx> {
             match self.tcx.impl_of_method(def_id) {
                 Some(impl_id) => match self.tcx.hir().get_if_local(impl_id) {
                     Some(Node::Item(item)) => match item.kind {
-                        hir::ItemKind::Impl { ref self_ty, .. } => {
+                        hir::ItemKind::Impl(hir::Impl { ref self_ty, .. }) => {
                             let hir = self.tcx.hir();
 
                             let mut qualname = String::from("<");