Closed
Description
I'm not sure if this is expected. In this code I've used a const test function, and I call it inside a const assert:
macro_rules! const_assert {
($x:expr $(,)?) => {
const _: () = assert!($x);
};
}
fn main() {
const fn test(n: u32) -> bool {
n > 0
}
const N: u32 = 100;
const_assert!(test(N));
dbg!(N);
}
This code works correctly, but rusts gives a "warning: function test
is never used".