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.
This commit is contained in:
Joshua Nelson 2020-11-22 17:46:21 -05:00
parent fd34606ddf
commit a8ff647deb
61 changed files with 258 additions and 246 deletions

View file

@ -501,7 +501,7 @@ impl<'hir> Sig for hir::Item<'hir> {
Ok(sig)
}
hir::ItemKind::Impl {
hir::ItemKind::Impl(hir::Impl {
unsafety,
polarity,
defaultness,
@ -511,7 +511,7 @@ impl<'hir> Sig for hir::Item<'hir> {
ref of_trait,
ref self_ty,
items: _,
} => {
}) => {
let mut text = String::new();
if let hir::Defaultness::Default { .. } = defaultness {
text.push_str("default ");