We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent c58f3c1 commit fdec2a4Copy full SHA for fdec2a4
clippy_lints/src/reference.rs
@@ -48,8 +48,8 @@ impl EarlyLintPass for DerefAddrOf {
48
fn check_expr(&mut self, cx: &EarlyContext<'_>, e: &Expr) {
49
if let ExprKind::Unary(UnOp::Deref, ref deref_target) = e.kind
50
&& 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(..))
+ // NOTE(tesuji): semantics diffences with/out `*&` for array literal `[x, y, ..]`
+ && !matches!(addrof_target.kind, ExprKind::Array(_))
53
&& deref_target.span.eq_ctxt(e.span)
54
&& !addrof_target.span.from_expansion()
55
{
0 commit comments