Re: [PATCH] rust: soc: silence clippy warning with rustc >= 1.88

From: Alexandre Courbot

Date: Tue Jul 07 2026 - 08:15:21 EST


On Tue Jul 7, 2026 at 8:43 PM JST, Gary Guo wrote:
> On Tue Jul 7, 2026 at 11:12 AM BST, Alexandre Courbot wrote:
>> The `clippy::unwrap_or_default` warning triggers on
>> `rust/kernel/soc.rs` since rustc 1.88:
>>
>> warning: use of `unwrap_or` to construct default value
>> --> ../rust/kernel/soc.rs:66:10
>> |
>> 66 | .unwrap_or(core::ptr::null())
>> | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `unwrap_or_default()`
>> |
>> = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.96.0/index.html#unwrap_or_default
>> = note: `-W clippy::unwrap-or-default` implied by `-W clippy::all`
>> = help: to override `-W clippy::all` add `#[allow(clippy::unwrap_or_default)]`
>>
>> Since our current MSRV is 1.85, we cannot fix the warning as
>> recommended, so allow the lint on the `cstring_to_c` function instead.
>
> We set `msrv = "1.85"` in our .clippy.toml, and my local testing with 1.88 and
> 1.96.1 doesn't produce this warning.

Then I guess we will want to understand why I am getting this warning
locally. I'd also expect the `msrv = "1.85"` to prevent this from
happening.