1
0
mirror of https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git synced 2026-01-12 01:20:14 +00:00
Gary Guo ecaa6ddff2 rust: add build_error crate
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>
Reviewed-by: Wei Liu <wei.liu@kernel.org>
[Reworded, adapted for upstream and applied latest changes]
Signed-off-by: Miguel Ojeda <ojeda@kernel.org>
2022-12-04 01:59:16 +01:00
..
2022-05-09 17:20:37 -07:00
2021-09-08 11:50:26 -07:00
2022-09-26 12:19:12 -07:00
2022-03-07 12:48:35 -07:00
2022-09-01 18:04:43 +02:00
2022-04-22 21:30:57 +02:00
2022-03-07 12:48:35 -07:00
2022-04-29 14:38:01 -07:00
2022-07-10 13:55:49 -07:00
2022-10-03 14:03:21 -07:00
2022-12-04 01:59:16 +01:00
2022-10-03 14:03:22 -07:00
2022-10-03 17:34:32 -07:00
2021-09-17 13:52:17 +01:00
2022-06-03 10:34:34 -07:00
2022-01-20 08:52:54 +02:00
2022-10-10 11:24:19 -07:00