about summary refs log tree commit diff
path: root/src/tools/rustfmt
diff options
context:
space:
mode:
authorEric Holk <ericholk@microsoft.com>2024-09-20 15:44:43 -0700
committerEric Holk <ericholk@microsoft.com>2024-10-07 11:15:15 -0700
commitb490bf56b7da3a689f0ea7a46f56d7cd2339efb0 (patch)
tree3d3eaa35bf23ce3bd06e995952f71d9cf776b2c3 /src/tools/rustfmt
parentae698f819935aae8623f41aa3837cc0a07903c1a (diff)
downloadrust-b490bf56b7da3a689f0ea7a46f56d7cd2339efb0.tar.gz
rust-b490bf56b7da3a689f0ea7a46f56d7cd2339efb0.zip
Fix clippy and rustfmt compilation
Diffstat (limited to 'src/tools/rustfmt')
-rw-r--r--src/tools/rustfmt/src/types.rs11
1 files changed, 6 insertions, 5 deletions
diff --git a/src/tools/rustfmt/src/types.rs b/src/tools/rustfmt/src/types.rs
index b64e069e096..999deb5dd4a 100644
--- a/src/tools/rustfmt/src/types.rs
+++ b/src/tools/rustfmt/src/types.rs
@@ -827,8 +827,9 @@ impl Rewrite for ast::Ty {
 
                 rewrite_unary_prefix(context, prefix, &*mt.ty, shape)
             }
-            ast::TyKind::Ref(ref lifetime, _pinned, ref mt) => {
-                // FIXME: format pinnedness
+            ast::TyKind::Ref(ref lifetime, ref mt)
+            | ast::TyKind::PinnedRef(ref lifetime, ref mt) => {
+                // FIXME(pin_ergonomics): correctly format pinned reference syntax
                 let mut_str = format_mutability(mt.mutbl);
                 let mut_len = mut_str.len();
                 let mut result = String::with_capacity(128);
@@ -1263,9 +1264,9 @@ pub(crate) fn can_be_overflowed_type(
 ) -> bool {
     match ty.kind {
         ast::TyKind::Tup(..) => context.use_block_indent() && len == 1,
-        ast::TyKind::Ref(_, _, ref mutty) | ast::TyKind::Ptr(ref mutty) => {
-            can_be_overflowed_type(context, &*mutty.ty, len)
-        }
+        ast::TyKind::Ref(_, ref mutty)
+        | ast::TyKind::PinnedRef(_, ref mutty)
+        | ast::TyKind::Ptr(ref mutty) => can_be_overflowed_type(context, &*mutty.ty, len),
         _ => false,
     }
 }