rust/tests/ui/consts/auxiliary/external_macro.rs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

15 lines
369 B
Rust
Raw Normal View History

#![feature(allow_internal_unstable)]
// Macro to help ensure CONST_ERR lint errors
// are not silenced in external macros.
// https://github.com/rust-lang/rust/issues/65300
#[macro_export]
#[allow_internal_unstable(type_ascription)]
macro_rules! static_assert {
($test:expr) => {
#[allow(dead_code)]
const _: () = [()][!($test) as usize];
}
}