Skip to content

Build-time assertion - #257

Merged
ojeda merged 3 commits into
Rust-for-Linux:rustfrom
nbdd0121:link-time-panic
May 19, 2021
Merged

ojeda merged 3 commits into
Rust-for-Linux:rustfrom
nbdd0121:link-time-panic

Conversation

@nbdd0121

@nbdd0121 nbdd0121 commented May 9, 2021

Copy link
Copy Markdown
Member

Add link_time_panic and link_time_assert!. link_time_panic is defined as a const but #[inline(never)] function, so it panics when used in const context, but will not be inlined. This crate is not used when linking, so if optimiser cannot optimize away a callsite a link error is generated.

Loading
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

8 participants