Rollup merge of #63582 - JohnTitor:fix-ice-63226, r=oli-obk
Fix ICE #63226 Fixes #63226 r? @oli-obk
This commit is contained in:
commit
19d6178b8f
3 changed files with 34 additions and 0 deletions
14
src/test/ui/consts/auxiliary/issue-63226.rs
Normal file
14
src/test/ui/consts/auxiliary/issue-63226.rs
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
pub struct VTable{
|
||||
state:extern fn(),
|
||||
}
|
||||
|
||||
impl VTable{
|
||||
pub const fn vtable()->&'static VTable{
|
||||
Self::VTABLE
|
||||
}
|
||||
|
||||
const VTABLE: &'static VTable =
|
||||
&VTable{state};
|
||||
}
|
||||
|
||||
extern fn state() {}
|
||||
12
src/test/ui/consts/issue-63226.rs
Normal file
12
src/test/ui/consts/issue-63226.rs
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
// aux-build:issue-63226.rs
|
||||
// compile-flags:--extern issue_63226
|
||||
// edition:2018
|
||||
// build-pass
|
||||
// A regression test for issue #63226.
|
||||
// Checks if `const fn` is marked as reachable.
|
||||
|
||||
use issue_63226::VTable;
|
||||
|
||||
static ICE_ICE:&'static VTable=VTable::vtable();
|
||||
|
||||
fn main() {}
|
||||
Loading…
Add table
Add a link
Reference in a new issue