Skip to content

Commit 7590f5c

Browse files
authored
Rollup merge of #138929 - oli-obk:assoc-ctxt-of-trait, r=compiler-errors
Visitors track whether an assoc item is in a trait impl or an inherent impl `AssocCtxt::Impl` now contains an `of_trait` field. This allows ast lowering and nameres to not have to track whether we're in a trait impl or an inherent impl.
2 parents b661e49 + b3b26f4 commit 7590f5c

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/visitor.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -624,7 +624,8 @@ impl<'b, 'a: 'b> FmtVisitor<'a> {
624624
// TODO(calebcartwright): Not sure the skip spans are correct
625625
let (ai, skip_span, assoc_ctxt) = match visitor_kind {
626626
AssocTraitItem(ai) => (*ai, ai.span(), visit::AssocCtxt::Trait),
627-
AssocImplItem(ai) => (*ai, ai.span, visit::AssocCtxt::Impl),
627+
// There is no difference between trait and inherent assoc item formatting
628+
AssocImplItem(ai) => (*ai, ai.span, visit::AssocCtxt::Impl { of_trait: false }),
628629
_ => unreachable!(),
629630
};
630631
skip_out_of_file_lines_range_visitor!(self, ai.span);

0 commit comments

Comments
 (0)