Re: [PATCH v5 4/4] rust: adding OwnableRefCounted and SimpleOwnableRefCounted
From: Alice Ryhl
Date: Fri Mar 07 2025 - 08:29:32 EST
On Fri, Mar 07, 2025 at 02:16:32PM +0100, Miguel Ojeda wrote:
> > +// TODO: enable this when compiler supports it (>=1.85)
> > +// #[diagnostic::do_not_recommend]
>
> I think (untested) we could conditionally enable this already and
> remove the `TODO` with something like:
>
> config RUSTC_HAS_DO_NOT_RECOMMEND
> def_bool RUSTC_VERSION >= 108500
>
> #[cfg_attr(CONFIG_RUSTC_HAS_DO_NOT_RECOMMEND, diagnostic::do_not_recommend)]
It's only a warning on older compilers. We could just add this in
lib.rs:
#![allow(unknown_or_malformed_diagnostic_attributes)]
Alice