Skip to content

Commit

Permalink
Merge pull request torvalds#778 from Rust-for-Linux/alex-patch-1
Browse files Browse the repository at this point in the history
rust: implement static_assert! in a more idiomatic way
  • Loading branch information
ojeda authored May 25, 2022
2 parents 25767f7 + c59939b commit d3ddae3
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions rust/kernel/static_assert.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,6 @@
#[macro_export]
macro_rules! static_assert {
($condition:expr) => {
// Based on the latest one in `rustc`'s one before it was [removed].
//
// [removed]: https://github.com/rust-lang/rust/commit/c2dad1c6b9f9636198d7c561b47a2974f5103f6d
#[allow(dead_code)]
const _: () = [()][!($condition) as usize];
const _: () = core::assert!($condition);
};
}

0 comments on commit d3ddae3

Please sign in to comment.