rust/tests/ui/mir/auxiliary/static_fnptr.rs

12 lines
139 B
Rust
Raw Normal View History

2024-04-09 23:17:45 +00:00
//@ compile-flags:-O
2024-05-04 19:27:27 +00:00
#[inline]
2024-04-09 23:17:45 +00:00
fn foo() {}
pub static ADDR: fn() = foo;
#[inline(always)]
pub fn bar(x: fn()) -> bool {
x == ADDR
}