lkml.org 
[lkml]   [2022]   [Dec]   [2]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v2 25/28] rust: add `build_error` crate
On Fri, Dec 02, 2022 at 05:14:56PM +0100, ojeda@kernel.org wrote:
> From: Gary Guo <gary@garyguo.net>
>
> The `build_error` crate provides a function `build_error` which
> will panic at compile-time if executed in const context and,
> by default, will cause a build error if not executed at compile
> time and the optimizer does not optimise away the call.
>
> The `CONFIG_RUST_BUILD_ASSERT_ALLOW` kernel option allows to
> relax the default build failure and convert it to a runtime
> check. If the runtime check fails, `panic!` will be called.
>
> Its functionality will be exposed to users as a couple macros in
> the `kernel` crate in the following patch, thus some documentation
> here refers to them for simplicity.
>
> Signed-off-by: Gary Guo <gary@garyguo.net>
> [Reworded, adapted for upstream and applied latest changes]
> Signed-off-by: Miguel Ojeda <ojeda@kernel.org>

Reviewed-by: Wei Liu <wei.liu@kernel.org>

\
 
 \ /
  Last update: 2022-12-02 19:32    [W:0.127 / U:0.308 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site