Skip to content

Commit d3ddae3

Browse files
authored
Merge pull request #778 from Rust-for-Linux/alex-patch-1
rust: implement static_assert! in a more idiomatic way
2 parents 25767f7 + c59939b commit d3ddae3

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 _: () = core::assert!($condition);
3733
};
3834
}

0 commit comments

Comments
 (0)