about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorVadim Petrochenkov <vadim.petrochenkov@gmail.com>2024-03-15 14:21:03 +0300
committerVadim Petrochenkov <vadim.petrochenkov@gmail.com>2024-05-15 02:32:59 +0300
commit05a2db7624bfdb8fcd0541acbda04671bf742c2d (patch)
tree37b752414455f5f7ed4ec981c90475850d258c37 /src
parent2c7016776d9a2f84d73e7f028c81d897d9fe73b8 (diff)
downloadrust-05a2db7624bfdb8fcd0541acbda04671bf742c2d.tar.gz
rust-05a2db7624bfdb8fcd0541acbda04671bf742c2d.zip
delegation: Implement list delegation
```rust
reuse prefix::{a, b, c}
```
Diffstat (limited to 'src')
-rw-r--r--src/items.rs4
-rw-r--r--src/visitor.rs2
2 files changed, 3 insertions, 3 deletions
diff --git a/src/items.rs b/src/items.rs
index e196d1817f3..90e9e58ef9c 100644
--- a/src/items.rs
+++ b/src/items.rs
@@ -739,8 +739,8 @@ impl<'a> FmtVisitor<'a> {
                 (_, Const(..)) => Ordering::Greater,
                 (MacCall(..), _) => Ordering::Less,
                 (_, MacCall(..)) => Ordering::Greater,
-                (Delegation(..), _) => Ordering::Less,
-                (_, Delegation(..)) => Ordering::Greater,
+                (Delegation(..), _) | (DelegationMac(..), _) => Ordering::Less,
+                (_, Delegation(..)) | (_, DelegationMac(..)) => Ordering::Greater,
             });
             let mut prev_kind = None;
             for (buf, item) in buffer {
diff --git a/src/visitor.rs b/src/visitor.rs
index 6209b37004b..e1c7dc35087 100644
--- a/src/visitor.rs
+++ b/src/visitor.rs
@@ -586,7 +586,7 @@ impl<'b, 'a: 'b> FmtVisitor<'a> {
                     );
                     self.push_rewrite(item.span, rewrite);
                 }
-                ast::ItemKind::Delegation(..) => {
+                ast::ItemKind::Delegation(..) | ast::ItemKind::DelegationMac(..) => {
                     // TODO: rewrite delegation items once syntax is established.
                     // For now, leave the contents of the Span unformatted.
                     self.push_rewrite(item.span, None)