about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2025-03-25 19:53:57 +0000
committerbors <bors@rust-lang.org>2025-03-25 19:53:57 +0000
commit43f0014ef0f242418674f49052ed39b70f73bc1c (patch)
tree926b46f8a13419513fdceed630a14fe9cf89e089 /src
parent40507bded561ca6d28f3e187aed8317bb81ce9e2 (diff)
parent1107fc7ad22b7a37b6235ca0356390a2fea8be45 (diff)
downloadrust-43f0014ef0f242418674f49052ed39b70f73bc1c.tar.gz
rust-43f0014ef0f242418674f49052ed39b70f73bc1c.zip
Auto merge of #138933 - matthiaskrgr:rollup-sjtqkoq, r=matthiaskrgr
Rollup of 8 pull requests

Successful merges:

 - #135745 (Recognise new IPv6 non-global range from IETF RFC 9602)
 - #137247 (cg_llvm: Reduce the visibility of types, modules and using declarations in `rustc_codegen_llvm`.)
 - #138317 (privacy: Visit types and traits in impls in type privacy lints)
 - #138581 (Abort in deadlock handler if we fail to get a query map)
 - #138776 (coverage: Separate span-extraction from unexpansion)
 - #138886 (Fix autofix for `self` and `self as …` in `unused_imports` lint)
 - #138924 (Reduce `kw::Empty` usage, part 3)
 - #138929 (Visitors track whether an assoc item is in a trait impl or an inherent impl)

r? `@ghost`
`@rustbot` modify labels: rollup
Diffstat (limited to 'src')
-rw-r--r--src/tools/rustfmt/src/visitor.rs3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/tools/rustfmt/src/visitor.rs b/src/tools/rustfmt/src/visitor.rs
index a5cfc542a17..5749d8c63fa 100644
--- a/src/tools/rustfmt/src/visitor.rs
+++ b/src/tools/rustfmt/src/visitor.rs
@@ -624,7 +624,8 @@ impl<'b, 'a: 'b> FmtVisitor<'a> {
         // TODO(calebcartwright): Not sure the skip spans are correct
         let (ai, skip_span, assoc_ctxt) = match visitor_kind {
             AssocTraitItem(ai) => (*ai, ai.span(), visit::AssocCtxt::Trait),
-            AssocImplItem(ai) => (*ai, ai.span, visit::AssocCtxt::Impl),
+            // There is no difference between trait and inherent assoc item formatting
+            AssocImplItem(ai) => (*ai, ai.span, visit::AssocCtxt::Impl { of_trait: false }),
             _ => unreachable!(),
         };
         skip_out_of_file_lines_range_visitor!(self, ai.span);