Skip to content

Commit 6988094

Browse files
committed
Fix clippy and rustfmt compilation
1 parent bd45002 commit 6988094

File tree

2 files changed

+8
-7
lines changed

2 files changed

+8
-7
lines changed

Diff for: src/tools/clippy/clippy_utils/src/ast_utils.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -722,8 +722,8 @@ pub fn eq_ty(l: &Ty, r: &Ty) -> bool {
722722
(Slice(l), Slice(r)) => eq_ty(l, r),
723723
(Array(le, ls), Array(re, rs)) => eq_ty(le, re) && eq_expr(&ls.value, &rs.value),
724724
(Ptr(l), Ptr(r)) => l.mutbl == r.mutbl && eq_ty(&l.ty, &r.ty),
725-
(Ref(ll, lp, l), Ref(rl, rp, r)) => {
726-
both(ll, rl, |l, r| eq_id(l.ident, r.ident)) && l.mutbl == r.mutbl && eq_ty(&l.ty, &r.ty) && lp == rp
725+
(Ref(ll, l), Ref(rl, r)) | (PinnedRef(ll, l), PinnedRef(rl, r)) => {
726+
both(ll, rl, |l, r| eq_id(l.ident, r.ident)) && l.mutbl == r.mutbl && eq_ty(&l.ty, &r.ty)
727727
},
728728
(BareFn(l), BareFn(r)) => {
729729
l.safety == r.safety

Diff for: src/tools/rustfmt/src/types.rs

+6-5
Original file line numberDiff line numberDiff line change
@@ -729,8 +729,9 @@ impl Rewrite for ast::Ty {
729729

730730
rewrite_unary_prefix(context, prefix, &*mt.ty, shape)
731731
}
732-
ast::TyKind::Ref(ref lifetime, _pinned, ref mt) => {
733-
// FIXME: format pinnedness
732+
ast::TyKind::Ref(ref lifetime, ref mt)
733+
| ast::TyKind::PinnedRef(ref lifetime, ref mt) => {
734+
// FIXME(pin_ergonomics): correctly format pinned reference syntax
734735
let mut_str = format_mutability(mt.mutbl);
735736
let mut_len = mut_str.len();
736737
let mut result = String::with_capacity(128);
@@ -1144,9 +1145,9 @@ pub(crate) fn can_be_overflowed_type(
11441145
) -> bool {
11451146
match ty.kind {
11461147
ast::TyKind::Tup(..) => context.use_block_indent() && len == 1,
1147-
ast::TyKind::Ref(_, _, ref mutty) | ast::TyKind::Ptr(ref mutty) => {
1148-
can_be_overflowed_type(context, &*mutty.ty, len)
1149-
}
1148+
ast::TyKind::Ref(_, ref mutty)
1149+
| ast::TyKind::PinnedRef(_, ref mutty)
1150+
| ast::TyKind::Ptr(ref mutty) => can_be_overflowed_type(context, &*mutty.ty, len),
11501151
_ => false,
11511152
}
11521153
}

0 commit comments

Comments
 (0)