Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

thread 'rustc' panicked #75682

Closed
TTTiNNNy opened this issue Aug 18, 2020 · 5 comments · Fixed by #80404
Closed

thread 'rustc' panicked #75682

TTTiNNNy opened this issue Aug 18, 2020 · 5 comments · Fixed by #80404
Labels
C-bug Category: This is a bug. glacier ICE tracked in rust-lang/glacier. I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ P-high High priority regression-from-stable-to-stable Performance or correctness regression from one stable version to another. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Comments

@TTTiNNNy
Copy link

TTTiNNNy commented Aug 18, 2020

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>

@TTTiNNNy TTTiNNNy added C-bug Category: This is a bug. I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Aug 18, 2020
@JohnTitor JohnTitor added the E-needs-mcve Call for participation: This issue has a repro, but needs a Minimal Complete and Verifiable Example label Aug 18, 2020
@JohnTitor
Copy link
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).

@connorskees
Copy link
Contributor

connorskees commented Aug 19, 2020

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

@JohnTitor JohnTitor removed the E-needs-mcve Call for participation: This issue has a repro, but needs a Minimal Complete and Verifiable Example label Aug 19, 2020
@JohnTitor
Copy link
Member

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

@JohnTitor JohnTitor added the regression-from-stable-to-stable Performance or correctness regression from one stable version to another. label Aug 19, 2020
@rustbot rustbot added the I-prioritize Issue: Indicates that prioritization has been requested for this issue. label Aug 19, 2020
@TTTiNNNy
Copy link
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

@spastorino
Copy link
Member

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

@spastorino spastorino added P-high High priority and removed I-prioritize Issue: Indicates that prioritization has been requested for this issue. labels Aug 19, 2020
@rust-lang-glacier-bot rust-lang-glacier-bot added the glacier ICE tracked in rust-lang/glacier. label Sep 8, 2020
@bors bors closed this as completed in 99f2f5a Feb 1, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-bug Category: This is a bug. glacier ICE tracked in rust-lang/glacier. I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ P-high High priority regression-from-stable-to-stable Performance or correctness regression from one stable version to another. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants