Closed
Description
Code
struct InterruptSectorManager {
field: &'static (),
}
static FOO: [InterruptSectorManager; 2] = [InterruptSectorManager { field: &() }; 2];
Original
pub const TASK_NUM: usize = 10;
pub const INTERRUPT_NUM: usize = 14;
#[derive(Debug, Clone,Copy)]
pub struct Node
{
pub(crate) elem: fn(),
pub(crate) next: *mut Node,
pub(crate) prev: *mut Node,
}
pub struct InterruptManager
{
pub(crate) interrupt_table: &'static[self::InterruptSectorManager;1 * desc::INTERRUPT_NUM],
}
pub struct InterruptSectorManager
{
//pub(crate) interrupt_sector_table: &'static[Node; desc::TASK_NUMB],
pub(crate) interrupt_sector_table: &'static [&'static [Node; desc::TASK_NUM]; desc::INTERRUPT_NUM],
}
pub static TASK_CONT: [Node; desc::TASK_NUM] =
[Node{ elem: def_fn , next: 0 as *mut Node, prev: 0 as *mut Node }; desc::TASK_NUM];
static interrupt_sector_table: [interrupt_manager::InterruptSectorManager; desc::INTERRUPT_NUM] =
[interrupt_manager::InterruptSectorManager{ interrupt_sector_table: &[&TASK_CONT; desc::INTERRUPT_NUM]}; desc::INTERRUPT_NUM];
pub static interrupt_manager: interrupt_manager::InterruptManager = interrupt_manager::InterruptManager{ interrupt_table: &interrupt_sector_table };
Meta
rustc --version --verbose
:
<version>
note: rustc 1.45.2 (d3fb005a3 2020-07-31) running on x86_64-unknown-linux-gnu
note: compiler flags: -C embed-bitcode=no -C debuginfo=2 -C incremental -C link-arg=-Tlink.x --crate-type lib
Error output
thread 'rustc' panicked at 'assertion failed: promoted.is_none()', src/librustc_mir/transform/check_consts/qualifs.rs:252:9
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
error: internal compiler error: unexpected panic
note: the compiler unexpectedly panicked. this is a bug.
<output>
Backtrace
<backtrace>