Skip to content

Commit fdec2a4

Browse files
committed
oops: semantics of repeat expr in array is the same
1 parent c58f3c1 commit fdec2a4

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

clippy_lints/src/reference.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,8 @@ impl EarlyLintPass for DerefAddrOf {
4848
fn check_expr(&mut self, cx: &EarlyContext<'_>, e: &Expr) {
4949
if let ExprKind::Unary(UnOp::Deref, ref deref_target) = e.kind
5050
&& let ExprKind::AddrOf(_, ref mutability, ref addrof_target) = without_parens(deref_target).kind
51-
// NOTE(tesuji): semantics diffences with/out `*&` for array
52-
&& !matches!(addrof_target.kind, ExprKind::Array(_) | ExprKind::Repeat(..))
51+
// NOTE(tesuji): semantics diffences with/out `*&` for array literal `[x, y, ..]`
52+
&& !matches!(addrof_target.kind, ExprKind::Array(_))
5353
&& deref_target.span.eq_ctxt(e.span)
5454
&& !addrof_target.span.from_expansion()
5555
{

0 commit comments

Comments
 (0)