Re: [PATCH v1] rust: bug: prevent dead_code warning from warn_on!'s flags constant

FUJITA Tomonori <[email protected]> Sat, 01 Aug 2026 11:50:09 +0900 (JST)
Newsgroups org.kernel.vger.rust-for-linux
Message-ID <[email protected]>
On Fri, 24 Jul 2026 14:23:23 +0100
"Gary Guo" <[email protected]> wrote:

>>> Also, the proper fix would be to mark it as used in the `warn_flags` macro
>>> that discard the expression.
>>> 
>>>     if false {
>>>         _ = $flags;
>>>     }
>>
>>
>> Yeah, having the callee that discards the argument consume it is more
>> logical than working around it at the caller. I'll send v2 shortly.
>>
>> The same reasoning applies to `$file`. Since there is no warning right
>> now, I'll rename `_COND_STR` to `COND_STR` and consume `$file` in a
>> separate patch for consistency.
> 
> Given that this is closely related to $flags I'd do it in a single patch.

Ok, I've just sent v3.