From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-4316.protonmail.ch (mail-4316.protonmail.ch [185.70.43.16]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 54A6A1EF08D; Wed, 12 Mar 2025 22:38:13 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=185.70.43.16 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1741819095; cv=none; b=GvkdxHDueCFsVFsiJd20W2742kvnZnS2tQPiElI7Sy5jzDlu8+9dNWiiGh0GBAKa099/bYov/4TKw8P0Gq/j8QDjoTlqunhPLdhM2ScPCRcONOqCKDoAig8ZP51dF3MMOSfzcE3Vkc4+n1ZVEnwWwpXu1icJLCMEDjJFCSoCQco= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1741819095; c=relaxed/simple; bh=hqMCxV3hHW8yDcWjXKSWU9xjhmxeTFtHqSjy4t4/WAU=; h=Date:To:From:Cc:Subject:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=RHQUT7lU8ONnqTAHclG4gUUytr7U9vlosnrGcx7+T6vOE7k7q/USIQ0ExExXhpOGS0VCrLjVchaujNJ8UnayXYi88IcVQepvBTjNS4e/2tKzu68BftLReQAEz39L3pMPrMGS2qu3uFKOjwe4TtYNEChvyQ/eRMCAu403iOax4n8= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=proton.me; spf=pass smtp.mailfrom=proton.me; dkim=pass (2048-bit key) header.d=proton.me header.i=@proton.me header.b=Y1PKVIOv; arc=none smtp.client-ip=185.70.43.16 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=proton.me Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=proton.me Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=proton.me header.i=@proton.me header.b="Y1PKVIOv" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=proton.me; s=protonmail; t=1741819090; x=1742078290; bh=ptExWFO1L9HF5KrYQKciiDZUKN13vD4sMJnJuckn30M=; h=Date:To:From:Cc:Subject:Message-ID:In-Reply-To:References: Feedback-ID:From:To:Cc:Date:Subject:Reply-To:Feedback-ID: Message-ID:BIMI-Selector:List-Unsubscribe:List-Unsubscribe-Post; b=Y1PKVIOvKC6EhKkRWZAjDEctvB7RmPNDKkXLW0wv0zkA9TPc7rLcFEzyyjRhf1MAJ PdCafG9+otGQHW2FGh9pOE5RsLlMfX7fSD4pEZoV0txxlIcNzyfUgpmNfG5oUfjp+T i/qcbs7aFEZMZ8O40xI9u3n+i4qUKo1Rb8/Yd4HZdpAWVm6h7+be7TdT4Sj6las1+N 8JBX9zRHlFZlQvlLutfADOKxSGjJIAYuN0IPcLJFzN2NUcTNcGenlIrs7ylh5Uehfj mRmmCP9FOzR0xBLTxBseRHp6sAwiyNl/4m1KPHz05xOcr6F0F7QqtcUMkkNVGiI7KV 8epgMAgAKtEUw== Date: Wed, 12 Mar 2025 22:38:03 +0000 To: Tamir Duberstein From: Benno Lossin Cc: Masahiro Yamada , Nathan Chancellor , Nicolas Schier , Miguel Ojeda , Alex Gaynor , Boqun Feng , Gary Guo , =?utf-8?Q?Bj=C3=B6rn_Roy_Baron?= , Andreas Hindborg , Alice Ryhl , Trevor Gross , Danilo Krummrich , Greg Kroah-Hartman , "Rafael J. Wysocki" , Brendan Higgins , David Gow , Rae Moar , Bjorn Helgaas , Luis Chamberlain , Russ Weight , Rob Herring , Saravana Kannan , linux-kbuild@vger.kernel.org, linux-kernel@vger.kernel.org, rust-for-linux@vger.kernel.org, linux-kselftest@vger.kernel.org, kunit-dev@googlegroups.com, linux-pci@vger.kernel.org, linux-block@vger.kernel.org, devicetree@vger.kernel.org Subject: Re: [PATCH v2 5/5] rust: enable `clippy::as_underscore` lint Message-ID: In-Reply-To: References: <20250309-ptr-as-ptr-v2-0-25d60ad922b7@gmail.com> Feedback-ID: 71780778:user:proton X-Pm-Message-ID: e5e352a766bd924d3132436297fc212a44299c51 Precedence: bulk X-Mailing-List: devicetree@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On Wed Mar 12, 2025 at 11:24 PM CET, Tamir Duberstein wrote: > On Wed, Mar 12, 2025 at 5:30=E2=80=AFPM Benno Lossin wrote: >> >> On Wed Mar 12, 2025 at 10:10 PM CET, Tamir Duberstein wrote: >> > On Wed, Mar 12, 2025 at 5:04=E2=80=AFPM Tamir Duberstein wrote: >> >> >> >> On Wed, Mar 12, 2025 at 5:01=E2=80=AFPM Benno Lossin wrote: >> >> > Always enable the features, we have `allow(stable_features)` for th= is >> >> > reason (then you don't have to do this dance with checking if it's >> >> > already stable or not :) >> >> >> >> It's not so simple. In rustc < 1.84.0 the lints *and* the strict >> >> provenance APIs are behind `feature(strict_provenance)`. In rustc >= =3D >> >> 1.84.0 the lints are behind `feature(strict_provenance_lints)`. So yo= u >> >> need to read the config to learn that you need to enable >> >> `feature(strict_provenance_lints)`. >> >> I see... And `strict_provenance_lints` doesn't exist in <1.84? That's a >> bit of a bummer... >> >> But I guess we could have this config option (in `init/Kconfig`): >> >> config RUSTC_HAS_STRICT_PROVENANCE >> def_bool RUSTC_VERSION >=3D 108400 >> >> and then do this in `lib.rs`: >> >> #![cfg_attr(CONFIG_RUSTC_HAS_STRICT_PROVENANCE, feature(strict_prove= nance_lints))] > > Yep! That's exactly what I did, but as I mentioned up-thread, the > result is that we only cover the `kernel` crate. Ah I see, can't we just have the above line in the other crate roots? >> > Actually this isn't even the only problem. It seems that >> > `-Astable_features` doesn't affect features enabled on the command >> > line at all: >> > >> > error[E0725]: the feature `strict_provenance` is not in the list of >> > allowed features >> > --> :1:9 >> > | >> > 1 | feature(strict_provenance) >> > | ^^^^^^^^^^^^^^^^^ >> >> That's because you need to append the feature to `rust_allowed_features` >> in `scripts/Makefile.build` (AFAIK). > > Thanks, that's a helpful pointer, and it solves some problems but not > all. The root Makefile contains this bit: > >> KBUILD_HOSTRUSTFLAGS :=3D $(rust_common_flags) -O -Cstrip=3Ddebuginfo \ >> -Zallow-features=3D $(HOSTRUSTFLAGS) > > which means we can't use the provenance lints against these host > targets (including e.g. `rustdoc_test_gen`). We can't remove this > -Zallow-features=3D either because then core fails to compile. > > I'm at the point where I think I need more involved help. Want to take > a look at my attempt? It's here: > https://github.com/tamird/linux/tree/b4/ptr-as-ptr. I'll take a look tomorrow, you're testing my knowledge of the build system a lot here :) --- Cheers, Benno