Re: [PATCH 2/3] rust: pin-init: examples: conditionally enable `feature(lint_reasons)`
From: Benno Lossin
Date: Thu Apr 17 2025 - 08:09:20 EST
On Wed Apr 16, 2025 at 11:58 PM CEST, Benno Lossin wrote:
> On Tue Apr 15, 2025 at 11:26 AM CEST, Alice Ryhl wrote:
>> On Mon, Apr 14, 2025 at 08:00:20PM +0000, Benno Lossin wrote:
>>> `lint_reasons` is unstable in Rust 1.80 and earlier, enable it
>>> conditionally in the examples to allow compiling them with older
>>> compilers.
>>>
>>> Link: https://github.com/Rust-for-Linux/pin-init/pull/33/commits/ec494fe686b0a97d5b59b5be5a42d3858038ea6a
>>> Signed-off-by: Benno Lossin <benno.lossin@xxxxxxxxx>
>>
>> Why not just always use #![feature] together with -Astable_features like
>> the kernel does?
>
> I'd like to know when a feature becomes stable, since I don't keep track
> of them like Miguel does.
Ah one more reason: `pin-init` must compile under stable (when not
enabling the `alloc` feature). And having `#![feature(..)]` is not
allowed under stable (even if the feature itself is stable).
---
Cheers,
Benno