diff options
| author | Eric Holk <ericholk@microsoft.com> | 2024-09-20 15:44:43 -0700 |
|---|---|---|
| committer | Eric Holk <ericholk@microsoft.com> | 2024-10-07 11:15:15 -0700 |
| commit | b490bf56b7da3a689f0ea7a46f56d7cd2339efb0 (patch) | |
| tree | 3d3eaa35bf23ce3bd06e995952f71d9cf776b2c3 /src/tools/rustfmt | |
| parent | ae698f819935aae8623f41aa3837cc0a07903c1a (diff) | |
| download | rust-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.rs | 11 |
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, } } |
