Closed
Description
From #269 (comment):
One small nit though: when the static assertion fails, the build error is very cryptic. It's not immediately obvious what has happened.
const MY_ERRNO: u32 = 40000; static_assert!((-(MY_ERRNO as i128)) fits in i16);error: any use of this value will cause an error --> rust/kernel/static_assert.rs:129:23 | 129 | const _: () = [()][!($condition) as usize]; | --------------^^^^^^^^^^^^^^^^^^^^^^^^^^^^- | | | index out of bounds: the length is 1 but the index is 1 | ::: rust/kernel/error.rs:113:1 | 113 | static_assert!((-(MY_ERRNO as i128)) fits in i16); | -------------------------------------------------- in this macro invocation | = note: `#[deny(const_err)]` on by default = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! = note: for more information, see issue #71800 <https://github.com/rust-lang/rust/issues/71800> = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info)