Re: [PATCH v6 1/3] rust: configfs: introduce rust support for configfs

From: Andreas Hindborg
Date: Fri May 02 2025 - 02:58:06 EST


"Miguel Ojeda" <miguel.ojeda.sandonis@xxxxxxxxx> writes:

> On Thu, May 1, 2025 at 11:28 PM Miguel Ojeda
> <miguel.ojeda.sandonis@xxxxxxxxx> wrote:
>>
>> Ah -- that explains it. Yeah, your calls to `add` were from const
>> contexts, which explains what you were trying to say.
>
> No, wait, they are not from const context. So a "normal" `assert!`
> there would have never worked.

Right, they are not from const context, but they are inside a `let`
statement, so if all the captured variables are constant (which they
are), the let statement will be evaluated in const context [1], right?

Best regards,
Andreas Hindborg


[1] https://doc.rust-lang.org/reference/const_eval.html#r-const-eval.const-context.init