Skip to content

Commit 7f1f62a

Browse files
authored
Implement static_assert! in a more idiomatic way
1 parent 25767f7 commit 7f1f62a

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

rust/kernel/static_assert.rs

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -29,10 +29,6 @@
2929
#[macro_export]
3030
macro_rules! static_assert {
3131
($condition:expr) => {
32-
// Based on the latest one in `rustc`'s one before it was [removed].
33-
//
34-
// [removed]: https://github.com/rust-lang/rust/commit/c2dad1c6b9f9636198d7c561b47a2974f5103f6d
35-
#[allow(dead_code)]
36-
const _: () = [()][!($condition) as usize];
32+
const _: () = assert!($condition);
3733
};
3834
}

0 commit comments

Comments
 (0)