Skip to content

thread 'rustc' panicked #75682

Description

@TTTiNNNy

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>

Activity

  1. added
    C-bugCategory: This is a bug.
    I-ICEIssue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️
    T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.
    on Aug 18, 2020
  2. added
    E-needs-mcveCall for participation: This issue has a repro, but needs a Minimal Complete and Verifiable Example
    on Aug 18, 2020
  3. JohnTitor commented on Aug 18, 2020

    @JohnTitor
    Member

    Could you provide an MCVE? I.e., it'd be great if your snippet works on https://play.rust-lang.org/ (at least, we should tweak elem).

  4. connorskees commented on Aug 19, 2020

    @connorskees
    Contributor

    Minified,

    struct InterruptSectorManager {
        field: &'static (),
    }
    
    static FOO: [InterruptSectorManager; 2] = [InterruptSectorManager { field: &() }; 2];

    Seems to have been introduced between at least 1.40.0 and 1.43.0

  5. removed
    E-needs-mcveCall for participation: This issue has a repro, but needs a Minimal Complete and Verifiable Example
    on Aug 19, 2020
  6. JohnTitor commented on Aug 19, 2020

    @JohnTitor
    Member

    It's a regression from 1.40.0 to 1.41.0, confirmed in godbolt (https://rust.godbolt.org/z/hssfz9).

  7. added
    I-prioritizeIssue needs a team member to assess the impact. Will be replaced by P-{low,medium,high,critical}
    on Aug 19, 2020
  8. TTTiNNNy commented on Aug 19, 2020

    @TTTiNNNy
    Author

    I guess reason of this mistake. Seem like, i get address of the newly created array here : interrupt_sector_table: &[&TASK_CONT; desc::INTERRUPT_NUM]}; desc::INTERRUPT_NUM];. Code was update by me and now its capable run on rust-playground

  9. spastorino commented on Aug 19, 2020

    @spastorino
    Member

    Assigning P-high as discussed as part of the Prioritization Working Group procedure and removing I-prioritize.

  10. added
    P-highHigh priority
    and removed
    I-prioritizeIssue needs a team member to assess the impact. Will be replaced by P-{low,medium,high,critical}
    on Aug 19, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-bugCategory: This is a bug.I-ICEIssue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️P-highHigh priorityT-compilerRelevant to the compiler team, which will review and decide on the PR/issue.glacierICE tracked in rust-lang/glacier.regression-from-stable-to-stablePerformance or correctness regression from one stable version to another.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions