We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
core_panic
1 parent 6837ae4 commit cb94e38Copy full SHA for cb94e38
rust/build_error.rs
@@ -13,18 +13,14 @@
13
//! functions could still be called in the runtime).
14
15
#![no_std]
16
-#![feature(core_panic)]
17
18
/// Panics if executed in const context, or triggers a build error if not.
19
#[inline(never)]
20
#[cold]
21
#[no_mangle]
22
#[track_caller]
23
pub const fn build_error(msg: &'static str) -> ! {
24
- // Could also be `panic!(msg)` to avoid using unstable feature `core_panic`,
25
- // but it is not allowed in Rust 2021, while `panic!("{}", msg)` could not
26
- // yet be used in const context.
27
- core::panicking::panic(msg);
+ panic!("{}", msg);
28
}
29
30
#[cfg(CONFIG_RUST_BUILD_ASSERT_WARN)]
0 commit comments