Received: by 2002:ab2:1149:0:b0:1f3:1f8c:d0c6 with SMTP id z9csp1952283lqz; Tue, 2 Apr 2024 02:47:01 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUqP/w3LIsrWIhpldiwp+Nx9QCNw3xRCyrZmMB4j2IeYAjN+sxJ+ZAxcUkiYd5Dt9bTMKUrMxGvcGsOtBAVntrWluOk1DGKko8uxGNl/Q== X-Google-Smtp-Source: AGHT+IGfcZZIdn5MDTPYo5azZv8cTDxw3rH7gbJLsgamwfhW7t/WWlBO8aOi2kJPn2kk5v5R9p6z X-Received: by 2002:a17:902:7285:b0:1dd:76f0:3dde with SMTP id d5-20020a170902728500b001dd76f03ddemr10079943pll.31.1712051221278; Tue, 02 Apr 2024 02:47:01 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1712051221; cv=pass; d=google.com; s=arc-20160816; b=Jvbm4va/YJGn8/gXMvjWDLmDyP1iFVR+hity1fJ9Yy+niCNxxem3JhI+8ahux0k9W6 Mh+gk9ww0Wi+1m02S81Y02tev+0aFutldBUxV99wnEkbQOQalyTZLE9UTdtj3W9Euf39 +o2VCB0brZPD6tRaPIgxYteG+vBZWWnMyF1TEdBZ6cZglaDb3WQyg+uROLCZND623YVo B6sCHryCnN072eZkEWSP4ThnR0nGDJKJSaRXPF1Vhn9urydKKnpqtZ+5bRK8cMx5guhn jqS/Ixl+8rkJ8/O6xMwPcKXjtC3QDyqmIff0Qzk1LMJtPVl7oxgShxcPCKVPg8l0YnEe 6saw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:list-unsubscribe:list-subscribe :list-id:precedence:dkim-signature; bh=57Qln/YxVwij9SZ8Uk2+ZQTIMAfQPcYDAn1WRCFZujE=; fh=KlvMBIeoApBSWJvs1tye/Ji2U37s/bx/UzSIDpfybZg=; b=kAAUv+htcx6jNrrwtim5o7FmUKDM2LHMan4g7zwYNa/J/2HV+v9khNfcmDCis0omzb +2hIE7Qp9ITu6r+Vhhsed0abtn6NxQzqghJ4veYldpiBRHF9ufdufdDlJZzEvabJOw4x 6BBW/aDasJLHdp9paVLH/XKnNM962Ci9+zxRZ3eufZXOvtlci3cXPBD2orjGtFAti8y/ QvmlhX54aMxH2h9Za0YtUbObZrrN/41c24AoCBp+oz8p/V0BIvFNVfLj1DMJJfD7r5O3 loTKYnAvALbRI5dhC9Kz4zdagThYiRZv4Vnp2CpiIK8QmqBozJUJquvwHldjc0v3GKfr p8zA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=yLhI+zrw; arc=pass (i=1 spf=pass spfdomain=google.com dkim=pass dkdomain=google.com dmarc=pass fromdomain=google.com); spf=pass (google.com: domain of linux-kernel+bounces-127655-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-127655-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id lq14-20020a170903144e00b001e0d9db62basi10974821plb.605.2024.04.02.02.47.01 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 02 Apr 2024 02:47:01 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-127655-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=yLhI+zrw; arc=pass (i=1 spf=pass spfdomain=google.com dkim=pass dkdomain=google.com dmarc=pass fromdomain=google.com); spf=pass (google.com: domain of linux-kernel+bounces-127655-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-127655-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id EAED5282D2C for ; Tue, 2 Apr 2024 09:47:00 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 3BB9758AD3; Tue, 2 Apr 2024 09:46:54 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="yLhI+zrw" Received: from mail-ua1-f48.google.com (mail-ua1-f48.google.com [209.85.222.48]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 91E4A58AA8 for ; Tue, 2 Apr 2024 09:46:50 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.222.48 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712051213; cv=none; b=PUk3XMNwULHW1HCA3+ii1LsojsyM04v6TQNSA4mj8cNePgRvjqcm2WyHO0B9ALL+TB1o1ugdppJD4xpHVwrpQlHFRvSZKI2OrTGw9gSTgwQi8STYRXzc87Xfynci6BnE5UGTEms96czBNFrNKZ/KxV1/cgEJ3eNI3TYsYjUlVEY= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712051213; c=relaxed/simple; bh=5KWH23f+CkrAqT9Dewsp1JwFaTdF1nWGTz25jhY/NPI=; h=MIME-Version:References:In-Reply-To:From:Date:Message-ID:Subject: To:Cc:Content-Type; b=m2qGrIpelon6oWW01BM8yyDVCIeJXxDyboMtSRrjSb/tXppW2KFMdR5edSB/lvp0+g0hnNuEiAlZcRi1FvbaOPUF6TTFIvqyJWjHVU1mpnbZsdm3eJvSMws55CDJ36Z+fNjw2L6xKCoaC/M0ijQYMZ3JQhotaJlrPh8s4+iEN5U= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com; spf=pass smtp.mailfrom=google.com; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b=yLhI+zrw; arc=none smtp.client-ip=209.85.222.48 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=google.com Received: by mail-ua1-f48.google.com with SMTP id a1e0cc1a2514c-7e3257325b4so1258436241.3 for ; Tue, 02 Apr 2024 02:46:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1712051209; x=1712656009; darn=vger.kernel.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=57Qln/YxVwij9SZ8Uk2+ZQTIMAfQPcYDAn1WRCFZujE=; b=yLhI+zrwtxI3VaK5lxCY3ULGIPbwb04n6jpUe89ytnk0jfN++DmLywBLy/pvBXYw13 okgEQSs7ACndlT0jwHhTBAzxGz3qMzAMUkAbnlEXveLVARv35W1CtAX2s6k+GaxheO2+ IzYkG1yi6omVZhxLPrBNfhmnu7kJtPspsx1WZSOXvWMoVfE/IxN0N3+zWV7eQF3afi2P S36FMQh/jxHJRilqE2EvM3S3ZKnix75CHNxSEv1GTO1XihECeL1GKPjEHn+6G5pQLWkI F8GkqtLi40FpfYZYnp1wFYDhIyuRuJxFv1NEBAcCH3s9xljJpDbtOPBF6bIJ+roAzy+F vl0Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1712051209; x=1712656009; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=57Qln/YxVwij9SZ8Uk2+ZQTIMAfQPcYDAn1WRCFZujE=; b=EQ/Q+MkVkEmwVFLQqzX9FxKurBhLfsCNLz5Skzx1QImYYy8Be7OIBVEy+Ye+Vwp12e 2COAq8VSjT6XGQETmZ/FqJx6Bt1By4ZTNqVEhD9xqfufiGC10OwU/Ox/Dxerritih0Iw gagNICT7H/SaZ/jkOiFaTPTjVDZcLOK67FvoYxkoGn/xRbtZXcgYaeeUZW54V7bup075 fyoCrppM1jUbH30PMtcV6DoVdHGpvxZbUkenf4y3qMVPncZ3/6AWd3+CnkSc047KLBur N9Gc25rj7ic4VpMhaAHbsvYNp9sCwADoUR33oe6KpLyiqpzKs/ede6D7fw5gXZVG98XR T/Qw== X-Forwarded-Encrypted: i=1; AJvYcCX4YYaqPQOSpElC5OLxVL3VzN5zx5SOKhkkgCMzvMwjYymFhQ0fW4K/2gyPWOiN7MolnE0smxvhjY9g08ueELE8pTyVBuSR0fp0NtpO X-Gm-Message-State: AOJu0Yxjg7ma7mzBf0S7ZKsJU678ZqkSY8WcYHxhRdz0qgdxfVTsMf5c Fo/wq9HP260DURU6yjixOPyRnGZpq/N67x02Onc7a4Ua5quAl7dFCw6E3yM+K/vTclo6qmCsu6o +GM3ypNAdWESdY6UVSU0RpY7M1A303FWp/E5E X-Received: by 2002:a05:6122:c90:b0:4d3:4aad:22d4 with SMTP id ba16-20020a0561220c9000b004d34aad22d4mr9329783vkb.0.1712051209441; Tue, 02 Apr 2024 02:46:49 -0700 (PDT) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 References: <20240401212303.537355-1-ojeda@kernel.org> <20240401212303.537355-2-ojeda@kernel.org> In-Reply-To: <20240401212303.537355-2-ojeda@kernel.org> From: Alice Ryhl Date: Tue, 2 Apr 2024 11:46:38 +0200 Message-ID: Subject: Re: [PATCH 1/3] rust: sync: implement `Default` for `LockClassKey` To: Miguel Ojeda Cc: Wedson Almeida Filho , Alex Gaynor , Boqun Feng , Gary Guo , =?UTF-8?Q?Bj=C3=B6rn_Roy_Baron?= , Benno Lossin , Andreas Hindborg , rust-for-linux@vger.kernel.org, linux-kernel@vger.kernel.org, patches@lists.linux.dev Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Mon, Apr 1, 2024 at 11:23=E2=80=AFPM Miguel Ojeda wro= te: > > In the upcoming Rust 1.78.0, Clippy suggests to implement `Default` even > when `new()` is `const`, since `Default::default()` may call `const` > functions even if it is not `const` itself [1]: > > error: you should consider adding a `Default` implementation for `Loc= kClassKey` > --> rust/kernel/sync.rs:31:5 > | > 31 | / pub const fn new() -> Self { > 32 | | Self(Opaque::uninit()) > 33 | | } > | |_____^ > > Thus implement it. > > Link: https://github.com/rust-lang/rust-clippy/pull/10903 [1] > Signed-off-by: Miguel Ojeda Reviewed-by: Alice Ryhl