rust/tests/ui/consts/auxiliary/issue-63226.rs
Ralf Jung d94f6576dd extend doc comment for reachability set computation
also extend the const fn reachability test
2024-03-25 19:57:57 +01:00

26 lines
605 B
Rust

pub struct VTable{
state:extern "C" fn(),
}
impl VTable {
pub const fn vtable()->&'static VTable{
Self::VTABLE
}
const VTABLE: &'static VTable =
&VTable{state};
pub const VTABLE2: &'static VTable =
&VTable{state: state2};
}
pub const VTABLE3: &'static VTable =
&VTable{state: state3};
// Only referenced via a `pub const fn`, and yet reachable.
extern "C" fn state() {}
// Only referenced via a associated `pub const`, and yet reachable.
extern "C" fn state2() {}
// Only referenced via a free `pub const`, and yet reachable.
extern "C" fn state3() {}