Files
rust/tests/ui/consts/auxiliary/issue-63226.rs

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

26 lines
605 B
Rust
Raw Normal View History

2019-08-15 13:56:57 +09:00
pub struct VTable{
state:extern "C" fn(),
2019-08-15 13:56:57 +09:00
}
impl VTable {
2019-08-15 13:56:57 +09:00
pub const fn vtable()->&'static VTable{
Self::VTABLE
}
const VTABLE: &'static VTable =
&VTable{state};
pub const VTABLE2: &'static VTable =
&VTable{state: state2};
2019-08-15 13:56:57 +09:00
}
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() {}