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

ice: broken mir: end of phase transition to Optimization compiler/rustc_const_eval/src/transform/validate.rs:119:36 #92495

Open
matthiaskrgr opened this issue Jan 2, 2022 · 11 comments
Labels
C-bug Category: This is a bug. E-needs-test Call for participation: An issue has been fixed and does not reproduce, but no test has been added. glacier ICE tracked in rust-lang/glacier. 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.

Comments

@matthiaskrgr
Copy link
Member

Code

code from ./compiler/rustc_codegen_gcc/tests/run/condition.rs

#![feature(arbitrary_self_types, auto_traits, lang_items, no_core, start, intrinsics)]

#![no_std]
#![no_core]

/*
 * Core
 */

// Because we don't have core yet.
#[lang = "sized"]
pub trait Sized {}

#[lang = "copy"]
trait Copy {
}

#[lang = "receiver"]
trait Receiver {
}

mod libc {
    #[link(name = "c")]
    extern "C" {
        pub fn printf(format: *const i8, ...) -> i32;
        pub fn puts(s: *const u8) -> i32;
    }
}


mod intrinsics {
    extern "rust-intrinsic" {
        pub fn abort() -> !;
    }
}

#[lang = "add"]
trait Add<RHS = Self> {
    type Output;

    fn add(self, rhs: RHS) -> Self::Output;
}


#[lang = "eq"]
pub trait PartialEq<Rhs: ?Sized = Self> {
    fn eq(&self, other: &Rhs) -> bool;
    fn ne(&self, other: &Rhs) -> bool;
}


#[start]
fn main(argc: isize, _argv: *const *const u8) -> isize {
        let string =
            match argc {
                1 => b"1\n\0",
                _ => b"_\n\0",
            };
    0
}

Meta

rustc --version --verbose:

rustc 1.59.0-nightly (c14569225 2022-01-01)
binary: rustc
commit-hash: c145692254e86974941f2c92c643a23df0f13e82
commit-date: 2022-01-01
host: x86_64-unknown-linux-gnu
release: 1.59.0-nightly
LLVM version: 13.0.0

Error output

warning: unused variable: `string`
  --> ./compiler/rustc_codegen_gcc/tests/run/condition.rs:54:13
   |
54 |         let string =
   |             ^^^^^^ help: if this is intentional, prefix it with an underscore: `_string`
   |
   = note: `#[warn(unused_variables)]` on by default

warning: function is never used: `printf`
  --> ./compiler/rustc_codegen_gcc/tests/run/condition.rs:25:9
   |
25 |         pub fn printf(format: *const i8, ...) -> i32;
   |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   |
   = note: `#[warn(dead_code)]` on by default

warning: function is never used: `puts`
  --> ./compiler/rustc_codegen_gcc/tests/run/condition.rs:26:9
   |
26 |         pub fn puts(s: *const u8) -> i32;
   |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

warning: function is never used: `abort`
  --> ./compiler/rustc_codegen_gcc/tests/run/condition.rs:33:9
   |
33 |         pub fn abort() -> !;
   |         ^^^^^^^^^^^^^^^^^^^^

warning: 4 warnings emitted

error: internal compiler error: broken MIR in Item(WithOptConstParam { did: DefId(0:19 ~ condition[1c5b]::main), const_param_did: None }) (start of phase transition from Build) at bb0[2]:
                                `Operand::Copy` with non-`Copy` type isize
  --> ./compiler/rustc_codegen_gcc/tests/run/condition.rs:55:13
   |
55 |             match argc {
   |             ^^^^^^^^^^
   |
   = note: delayed at compiler/rustc_const_eval/src/transform/validate.rs:119:36

error: internal compiler error: broken MIR in Item(WithOptConstParam { did: DefId(0:19 ~ condition[1c5b]::main), const_param_did: None }) (after pass CheckPackedRef) at bb0[2]:
                                `Operand::Copy` with non-`Copy` type isize
  --> ./compiler/rustc_codegen_gcc/tests/run/condition.rs:55:13
   |
55 |             match argc {
   |             ^^^^^^^^^^
   |
   = note: delayed at compiler/rustc_const_eval/src/transform/validate.rs:119:36

error: internal compiler error: broken MIR in Item(WithOptConstParam { did: DefId(0:19 ~ condition[1c5b]::main), const_param_did: None }) (after pass CheckConstItemMutation) at bb0[2]:
                                `Operand::Copy` with non-`Copy` type isize
  --> ./compiler/rustc_codegen_gcc/tests/run/condition.rs:55:13
   |
55 |             match argc {
   |             ^^^^^^^^^^
   |
   = note: delayed at compiler/rustc_const_eval/src/transform/validate.rs:119:36

error: internal compiler error: broken MIR in Item(WithOptConstParam { did: DefId(0:19 ~ condition[1c5b]::main), const_param_did: None }) (after pass FunctionItemReferences) at bb0[2]:
                                `Operand::Copy` with non-`Copy` type isize
  --> ./compiler/rustc_codegen_gcc/tests/run/condition.rs:55:13
   |
55 |             match argc {
   |             ^^^^^^^^^^
   |
   = note: delayed at compiler/rustc_const_eval/src/transform/validate.rs:119:36

error: internal compiler error: broken MIR in Item(WithOptConstParam { did: DefId(0:19 ~ condition[1c5b]::main), const_param_did: None }) (after pass SimplifyCfg-initial) at bb0[2]:
                                `Operand::Copy` with non-`Copy` type isize
  --> ./compiler/rustc_codegen_gcc/tests/run/condition.rs:55:13
   |
55 |             match argc {
   |             ^^^^^^^^^^
   |
   = note: delayed at compiler/rustc_const_eval/src/transform/validate.rs:119:36

error: internal compiler error: broken MIR in Item(WithOptConstParam { did: DefId(0:19 ~ condition[1c5b]::main), const_param_did: None }) (after pass SanityCheck) at bb0[2]:
                                `Operand::Copy` with non-`Copy` type isize
  --> ./compiler/rustc_codegen_gcc/tests/run/condition.rs:55:13
   |
55 |             match argc {
   |             ^^^^^^^^^^
   |
   = note: delayed at compiler/rustc_const_eval/src/transform/validate.rs:119:36

error: internal compiler error: broken MIR in Item(WithOptConstParam { did: DefId(0:19 ~ condition[1c5b]::main), const_param_did: None }) (after pass PhaseChange-Const) at bb0[2]:
                                `Operand::Copy` with non-`Copy` type isize
  --> ./compiler/rustc_codegen_gcc/tests/run/condition.rs:55:13
   |
55 |             match argc {
   |             ^^^^^^^^^^
   |
   = note: delayed at compiler/rustc_const_eval/src/transform/validate.rs:119:36

error: internal compiler error: broken MIR in Item(WithOptConstParam { did: DefId(0:19 ~ condition[1c5b]::main), const_param_did: None }) (end of phase transition to Const) at bb0[2]:
                                `Operand::Copy` with non-`Copy` type isize
  --> ./compiler/rustc_codegen_gcc/tests/run/condition.rs:55:13
   |
55 |             match argc {
   |             ^^^^^^^^^^
   |
   = note: delayed at compiler/rustc_const_eval/src/transform/validate.rs:119:36

error: internal compiler error: broken MIR in Item(WithOptConstParam { did: DefId(0:19 ~ condition[1c5b]::main), const_param_did: None }) (start of phase transition from Const) at bb0[2]:
                                `Operand::Copy` with non-`Copy` type isize
  --> ./compiler/rustc_codegen_gcc/tests/run/condition.rs:55:13
   |
55 |             match argc {
   |             ^^^^^^^^^^
   |
   = note: delayed at compiler/rustc_const_eval/src/transform/validate.rs:119:36

error: internal compiler error: broken MIR in Item(WithOptConstParam { did: DefId(0:19 ~ condition[1c5b]::main), const_param_did: None }) (after pass PromoteTemps) at bb0[2]:
                                `Operand::Copy` with non-`Copy` type isize
  --> ./compiler/rustc_codegen_gcc/tests/run/condition.rs:55:13
   |
55 |             match argc {
   |             ^^^^^^^^^^
   |
   = note: delayed at compiler/rustc_const_eval/src/transform/validate.rs:119:36

error: internal compiler error: broken MIR in Item(WithOptConstParam { did: DefId(0:19 ~ condition[1c5b]::main), const_param_did: None }) (after pass SimplifyCfg-promote-consts) at bb0[2]:
                                `Operand::Copy` with non-`Copy` type isize
  --> ./compiler/rustc_codegen_gcc/tests/run/condition.rs:55:13
   |
55 |             match argc {
   |             ^^^^^^^^^^
   |
   = note: delayed at compiler/rustc_const_eval/src/transform/validate.rs:119:36

error: internal compiler error: broken MIR in Item(WithOptConstParam { did: DefId(0:19 ~ condition[1c5b]::main), const_param_did: None }) (end of phase transition to ConstPromotion) at bb0[2]:
                                `Operand::Copy` with non-`Copy` type isize
  --> ./compiler/rustc_codegen_gcc/tests/run/condition.rs:55:13
   |
55 |             match argc {
   |             ^^^^^^^^^^
   |
   = note: delayed at compiler/rustc_const_eval/src/transform/validate.rs:119:36

error: internal compiler error: broken MIR in DefId(0:19 ~ condition[1c5b]::main) (NoSolution): could not prove Binder(TraitPredicate(<isize as Copy>, polarity:Positive), [])
  |
  = note: delayed at compiler/rustc_borrowck/src/type_check/mod.rs:319:27

error: internal compiler error: broken MIR in Item(WithOptConstParam { did: DefId(0:19 ~ condition[1c5b]::main), const_param_did: None }) (start of phase transition from ConstPromotion) at bb0[2]:
                                `Operand::Copy` with non-`Copy` type isize
  --> ./compiler/rustc_codegen_gcc/tests/run/condition.rs:55:13
   |
55 |             match argc {
   |             ^^^^^^^^^^
   |
   = note: delayed at compiler/rustc_const_eval/src/transform/validate.rs:119:36

error: internal compiler error: broken MIR in Item(WithOptConstParam { did: DefId(0:19 ~ condition[1c5b]::main), const_param_did: None }) (after pass RemoveFalseEdges) at bb0[2]:
                                `Operand::Copy` with non-`Copy` type isize
  --> ./compiler/rustc_codegen_gcc/tests/run/condition.rs:55:13
   |
55 |             match argc {
   |             ^^^^^^^^^^
   |
   = note: delayed at compiler/rustc_const_eval/src/transform/validate.rs:119:36

error: internal compiler error: broken MIR in Item(WithOptConstParam { did: DefId(0:19 ~ condition[1c5b]::main), const_param_did: None }) (after pass SimplifyConstCondition-initial) at bb0[2]:
                                `Operand::Copy` with non-`Copy` type isize
  --> ./compiler/rustc_codegen_gcc/tests/run/condition.rs:55:13
   |
55 |             match argc {
   |             ^^^^^^^^^^
   |
   = note: delayed at compiler/rustc_const_eval/src/transform/validate.rs:119:36

error: internal compiler error: broken MIR in Item(WithOptConstParam { did: DefId(0:19 ~ condition[1c5b]::main), const_param_did: None }) (after pass RemoveNoopLandingPads) at bb0[2]:
                                `Operand::Copy` with non-`Copy` type isize
  --> ./compiler/rustc_codegen_gcc/tests/run/condition.rs:55:13
   |
55 |             match argc {
   |             ^^^^^^^^^^
   |
   = note: delayed at compiler/rustc_const_eval/src/transform/validate.rs:119:36

error: internal compiler error: broken MIR in Item(WithOptConstParam { did: DefId(0:19 ~ condition[1c5b]::main), const_param_did: None }) (after pass CleanupNonCodegenStatements) at bb0[2]:
                                `Operand::Copy` with non-`Copy` type isize
  --> ./compiler/rustc_codegen_gcc/tests/run/condition.rs:55:13
   |
55 |             match argc {
   |             ^^^^^^^^^^
   |
   = note: delayed at compiler/rustc_const_eval/src/transform/validate.rs:119:36

error: internal compiler error: broken MIR in Item(WithOptConstParam { did: DefId(0:19 ~ condition[1c5b]::main), const_param_did: None }) (after pass SimplifyCfg-early-opt) at bb0[1]:
                                `Operand::Copy` with non-`Copy` type isize
  --> ./compiler/rustc_codegen_gcc/tests/run/condition.rs:55:13
   |
55 |             match argc {
   |             ^^^^^^^^^^
   |
   = note: delayed at compiler/rustc_const_eval/src/transform/validate.rs:119:36

error: internal compiler error: broken MIR in Item(WithOptConstParam { did: DefId(0:19 ~ condition[1c5b]::main), const_param_did: None }) (after pass AddCallGuards) at bb0[1]:
                                `Operand::Copy` with non-`Copy` type isize
  --> ./compiler/rustc_codegen_gcc/tests/run/condition.rs:55:13
   |
55 |             match argc {
   |             ^^^^^^^^^^
   |
   = note: delayed at compiler/rustc_const_eval/src/transform/validate.rs:119:36

error: internal compiler error: broken MIR in Item(WithOptConstParam { did: DefId(0:19 ~ condition[1c5b]::main), const_param_did: None }) (after pass ElaborateDrops) at bb0[1]:
                                `Operand::Copy` with non-`Copy` type isize
  --> ./compiler/rustc_codegen_gcc/tests/run/condition.rs:55:13
   |
55 |             match argc {
   |             ^^^^^^^^^^
   |
   = note: delayed at compiler/rustc_const_eval/src/transform/validate.rs:119:36

error: internal compiler error: broken MIR in Item(WithOptConstParam { did: DefId(0:19 ~ condition[1c5b]::main), const_param_did: None }) (after pass AbortUnwindingCalls) at bb0[1]:
                                `Operand::Copy` with non-`Copy` type isize
  --> ./compiler/rustc_codegen_gcc/tests/run/condition.rs:55:13
   |
55 |             match argc {
   |             ^^^^^^^^^^
   |
   = note: delayed at compiler/rustc_const_eval/src/transform/validate.rs:119:36

error: internal compiler error: broken MIR in Item(WithOptConstParam { did: DefId(0:19 ~ condition[1c5b]::main), const_param_did: None }) (after pass AddMovesForPackedDrops) at bb0[1]:
                                `Operand::Copy` with non-`Copy` type isize
  --> ./compiler/rustc_codegen_gcc/tests/run/condition.rs:55:13
   |
55 |             match argc {
   |             ^^^^^^^^^^
   |
   = note: delayed at compiler/rustc_const_eval/src/transform/validate.rs:119:36

error: internal compiler error: broken MIR in Item(WithOptConstParam { did: DefId(0:19 ~ condition[1c5b]::main), const_param_did: None }) (after pass LowerIntrinsics) at bb0[1]:
                                `Operand::Copy` with non-`Copy` type isize
  --> ./compiler/rustc_codegen_gcc/tests/run/condition.rs:55:13
   |
55 |             match argc {
   |             ^^^^^^^^^^
   |
   = note: delayed at compiler/rustc_const_eval/src/transform/validate.rs:119:36

error: internal compiler error: broken MIR in Item(WithOptConstParam { did: DefId(0:19 ~ condition[1c5b]::main), const_param_did: None }) (after pass SimplifyCfg-elaborate-drops) at bb0[1]:
                                `Operand::Copy` with non-`Copy` type isize
  --> ./compiler/rustc_codegen_gcc/tests/run/condition.rs:55:13
   |
55 |             match argc {
   |             ^^^^^^^^^^
   |
   = note: delayed at compiler/rustc_const_eval/src/transform/validate.rs:119:36

error: internal compiler error: broken MIR in Item(WithOptConstParam { did: DefId(0:19 ~ condition[1c5b]::main), const_param_did: None }) (after pass Deaggregator) at bb0[1]:
                                `Operand::Copy` with non-`Copy` type isize
  --> ./compiler/rustc_codegen_gcc/tests/run/condition.rs:55:13
   |
55 |             match argc {
   |             ^^^^^^^^^^
   |
   = note: delayed at compiler/rustc_const_eval/src/transform/validate.rs:119:36

error: internal compiler error: broken MIR in Item(WithOptConstParam { did: DefId(0:19 ~ condition[1c5b]::main), const_param_did: None }) (end of phase transition to DropLowering) at bb0[1]:
                                `Operand::Copy` with non-`Copy` type isize
  --> ./compiler/rustc_codegen_gcc/tests/run/condition.rs:55:13
   |
55 |             match argc {
   |             ^^^^^^^^^^
   |
   = note: delayed at compiler/rustc_const_eval/src/transform/validate.rs:119:36

error: internal compiler error: broken MIR in Item(WithOptConstParam { did: DefId(0:19 ~ condition[1c5b]::main), const_param_did: None }) (start of phase transition from DropLowering) at bb0[1]:
                                `Operand::Copy` with non-`Copy` type isize
  --> ./compiler/rustc_codegen_gcc/tests/run/condition.rs:55:13
   |
55 |             match argc {
   |             ^^^^^^^^^^
   |
   = note: delayed at compiler/rustc_const_eval/src/transform/validate.rs:119:36

error: internal compiler error: broken MIR in Item(WithOptConstParam { did: DefId(0:19 ~ condition[1c5b]::main), const_param_did: None }) (after pass LowerSliceLenCalls) at bb0[1]:
                                `Operand::Copy` with non-`Copy` type isize
  --> ./compiler/rustc_codegen_gcc/tests/run/condition.rs:55:13
   |
55 |             match argc {
   |             ^^^^^^^^^^
   |
   = note: delayed at compiler/rustc_const_eval/src/transform/validate.rs:119:36

error: internal compiler error: broken MIR in Item(WithOptConstParam { did: DefId(0:19 ~ condition[1c5b]::main), const_param_did: None }) (after pass UninhabitedEnumBranching) at bb0[1]:
                                `Operand::Copy` with non-`Copy` type isize
  --> ./compiler/rustc_codegen_gcc/tests/run/condition.rs:55:13
   |
55 |             match argc {
   |             ^^^^^^^^^^
   |
   = note: delayed at compiler/rustc_const_eval/src/transform/validate.rs:119:36

error: internal compiler error: broken MIR in Item(WithOptConstParam { did: DefId(0:19 ~ condition[1c5b]::main), const_param_did: None }) (after pass SimplifyCfg-after-uninhabited-enum-branching) at bb0[1]:
                                `Operand::Copy` with non-`Copy` type isize
  --> ./compiler/rustc_codegen_gcc/tests/run/condition.rs:55:13
   |
55 |             match argc {
   |             ^^^^^^^^^^
   |
   = note: delayed at compiler/rustc_const_eval/src/transform/validate.rs:119:36

error: internal compiler error: broken MIR in Item(WithOptConstParam { did: DefId(0:19 ~ condition[1c5b]::main), const_param_did: None }) (after pass StateTransform) at bb0[1]:
                                `Operand::Copy` with non-`Copy` type isize
  --> ./compiler/rustc_codegen_gcc/tests/run/condition.rs:55:13
   |
55 |             match argc {
   |             ^^^^^^^^^^
   |
   = note: delayed at compiler/rustc_const_eval/src/transform/validate.rs:119:36

error: internal compiler error: broken MIR in Item(WithOptConstParam { did: DefId(0:19 ~ condition[1c5b]::main), const_param_did: None }) (end of phase transition to GeneratorLowering) at bb0[1]:
                                `Operand::Copy` with non-`Copy` type isize
  --> ./compiler/rustc_codegen_gcc/tests/run/condition.rs:55:13
   |
55 |             match argc {
   |             ^^^^^^^^^^
   |
   = note: delayed at compiler/rustc_const_eval/src/transform/validate.rs:119:36

error: internal compiler error: broken MIR in Item(WithOptConstParam { did: DefId(0:19 ~ condition[1c5b]::main), const_param_did: None }) (start of phase transition from GeneratorLowering) at bb0[1]:
                                `Operand::Copy` with non-`Copy` type isize
  --> ./compiler/rustc_codegen_gcc/tests/run/condition.rs:55:13
   |
55 |             match argc {
   |             ^^^^^^^^^^
   |
   = note: delayed at compiler/rustc_const_eval/src/transform/validate.rs:119:36

error: internal compiler error: broken MIR in Item(WithOptConstParam { did: DefId(0:19 ~ condition[1c5b]::main), const_param_did: None }) (after pass RemoveStorageMarkers) at bb0[0]:
                                `Operand::Copy` with non-`Copy` type isize
  --> ./compiler/rustc_codegen_gcc/tests/run/condition.rs:55:13
   |
55 |             match argc {
   |             ^^^^^^^^^^
   |
   = note: delayed at compiler/rustc_const_eval/src/transform/validate.rs:119:36

error: internal compiler error: broken MIR in Item(WithOptConstParam { did: DefId(0:19 ~ condition[1c5b]::main), const_param_did: None }) (after pass RemoveZsts) at bb0[0]:
                                `Operand::Copy` with non-`Copy` type isize
  --> ./compiler/rustc_codegen_gcc/tests/run/condition.rs:55:13
   |
55 |             match argc {
   |             ^^^^^^^^^^
   |
   = note: delayed at compiler/rustc_const_eval/src/transform/validate.rs:119:36

error: internal compiler error: broken MIR in Item(WithOptConstParam { did: DefId(0:19 ~ condition[1c5b]::main), const_param_did: None }) (after pass RemoveUnneededDrops) at bb0[0]:
                                `Operand::Copy` with non-`Copy` type isize
  --> ./compiler/rustc_codegen_gcc/tests/run/condition.rs:55:13
   |
55 |             match argc {
   |             ^^^^^^^^^^
   |
   = note: delayed at compiler/rustc_const_eval/src/transform/validate.rs:119:36

error: internal compiler error: broken MIR in Item(WithOptConstParam { did: DefId(0:19 ~ condition[1c5b]::main), const_param_did: None }) (after pass InstCombine) at bb0[0]:
                                `Operand::Copy` with non-`Copy` type isize
  --> ./compiler/rustc_codegen_gcc/tests/run/condition.rs:55:13
   |
55 |             match argc {
   |             ^^^^^^^^^^
   |
   = note: delayed at compiler/rustc_const_eval/src/transform/validate.rs:119:36

error: internal compiler error: broken MIR in Item(WithOptConstParam { did: DefId(0:19 ~ condition[1c5b]::main), const_param_did: None }) (after pass InstCombine) at bb1[1]:
                                `Operand::Copy` with non-`Copy` type &[u8; 3]
  --> ./compiler/rustc_codegen_gcc/tests/run/condition.rs:57:22
   |
57 |                 _ => b"_\n\0",
   |                      ^^^^^^^^
   |
   = note: delayed at compiler/rustc_const_eval/src/transform/validate.rs:119:36

error: internal compiler error: broken MIR in Item(WithOptConstParam { did: DefId(0:19 ~ condition[1c5b]::main), const_param_did: None }) (after pass ConstProp) at bb0[0]:
                                `Operand::Copy` with non-`Copy` type isize
  --> ./compiler/rustc_codegen_gcc/tests/run/condition.rs:55:13
   |
55 |             match argc {
   |             ^^^^^^^^^^
   |
   = note: delayed at compiler/rustc_const_eval/src/transform/validate.rs:119:36

error: internal compiler error: broken MIR in Item(WithOptConstParam { did: DefId(0:19 ~ condition[1c5b]::main), const_param_did: None }) (after pass ConstProp) at bb1[1]:
                                `Operand::Copy` with non-`Copy` type &[u8; 3]
  --> ./compiler/rustc_codegen_gcc/tests/run/condition.rs:57:22
   |
57 |                 _ => b"_\n\0",
   |                      ^^^^^^^^
   |
   = note: delayed at compiler/rustc_const_eval/src/transform/validate.rs:119:36

error: internal compiler error: broken MIR in Item(WithOptConstParam { did: DefId(0:19 ~ condition[1c5b]::main), const_param_did: None }) (after pass SimplifyConstCondition-after-const-prop) at bb0[0]:
                                `Operand::Copy` with non-`Copy` type isize
  --> ./compiler/rustc_codegen_gcc/tests/run/condition.rs:55:13
   |
55 |             match argc {
   |             ^^^^^^^^^^
   |
   = note: delayed at compiler/rustc_const_eval/src/transform/validate.rs:119:36

error: internal compiler error: broken MIR in Item(WithOptConstParam { did: DefId(0:19 ~ condition[1c5b]::main), const_param_did: None }) (after pass SimplifyConstCondition-after-const-prop) at bb1[1]:
                                `Operand::Copy` with non-`Copy` type &[u8; 3]
  --> ./compiler/rustc_codegen_gcc/tests/run/condition.rs:57:22
   |
57 |                 _ => b"_\n\0",
   |                      ^^^^^^^^
   |
   = note: delayed at compiler/rustc_const_eval/src/transform/validate.rs:119:36

error: internal compiler error: broken MIR in Item(WithOptConstParam { did: DefId(0:19 ~ condition[1c5b]::main), const_param_did: None }) (after pass SimplifyComparisonIntegral) at bb0[0]:
                                `Operand::Copy` with non-`Copy` type isize
  --> ./compiler/rustc_codegen_gcc/tests/run/condition.rs:55:13
   |
55 |             match argc {
   |             ^^^^^^^^^^
   |
   = note: delayed at compiler/rustc_const_eval/src/transform/validate.rs:119:36

error: internal compiler error: broken MIR in Item(WithOptConstParam { did: DefId(0:19 ~ condition[1c5b]::main), const_param_did: None }) (after pass SimplifyComparisonIntegral) at bb1[1]:
                                `Operand::Copy` with non-`Copy` type &[u8; 3]
  --> ./compiler/rustc_codegen_gcc/tests/run/condition.rs:57:22
   |
57 |                 _ => b"_\n\0",
   |                      ^^^^^^^^
   |
   = note: delayed at compiler/rustc_const_eval/src/transform/validate.rs:119:36

error: internal compiler error: broken MIR in Item(WithOptConstParam { did: DefId(0:19 ~ condition[1c5b]::main), const_param_did: None }) (after pass SimplifyArmIdentity) at bb0[0]:
                                `Operand::Copy` with non-`Copy` type isize
  --> ./compiler/rustc_codegen_gcc/tests/run/condition.rs:55:13
   |
55 |             match argc {
   |             ^^^^^^^^^^
   |
   = note: delayed at compiler/rustc_const_eval/src/transform/validate.rs:119:36

error: internal compiler error: broken MIR in Item(WithOptConstParam { did: DefId(0:19 ~ condition[1c5b]::main), const_param_did: None }) (after pass SimplifyArmIdentity) at bb1[1]:
                                `Operand::Copy` with non-`Copy` type &[u8; 3]
  --> ./compiler/rustc_codegen_gcc/tests/run/condition.rs:57:22
   |
57 |                 _ => b"_\n\0",
   |                      ^^^^^^^^
   |
   = note: delayed at compiler/rustc_const_eval/src/transform/validate.rs:119:36

error: internal compiler error: broken MIR in Item(WithOptConstParam { did: DefId(0:19 ~ condition[1c5b]::main), const_param_did: None }) (after pass SimplifyBranchSame) at bb0[0]:
                                `Operand::Copy` with non-`Copy` type isize
  --> ./compiler/rustc_codegen_gcc/tests/run/condition.rs:55:13
   |
55 |             match argc {
   |             ^^^^^^^^^^
   |
   = note: delayed at compiler/rustc_const_eval/src/transform/validate.rs:119:36

error: internal compiler error: broken MIR in Item(WithOptConstParam { did: DefId(0:19 ~ condition[1c5b]::main), const_param_did: None }) (after pass SimplifyBranchSame) at bb1[1]:
                                `Operand::Copy` with non-`Copy` type &[u8; 3]
  --> ./compiler/rustc_codegen_gcc/tests/run/condition.rs:57:22
   |
57 |                 _ => b"_\n\0",
   |                      ^^^^^^^^
   |
   = note: delayed at compiler/rustc_const_eval/src/transform/validate.rs:119:36

error: internal compiler error: broken MIR in Item(WithOptConstParam { did: DefId(0:19 ~ condition[1c5b]::main), const_param_did: None }) (after pass SimplifyConstCondition-final) at bb0[0]:
                                `Operand::Copy` with non-`Copy` type isize
  --> ./compiler/rustc_codegen_gcc/tests/run/condition.rs:55:13
   |
55 |             match argc {
   |             ^^^^^^^^^^
   |
   = note: delayed at compiler/rustc_const_eval/src/transform/validate.rs:119:36

error: internal compiler error: broken MIR in Item(WithOptConstParam { did: DefId(0:19 ~ condition[1c5b]::main), const_param_did: None }) (after pass SimplifyConstCondition-final) at bb1[1]:
                                `Operand::Copy` with non-`Copy` type &[u8; 3]
  --> ./compiler/rustc_codegen_gcc/tests/run/condition.rs:57:22
   |
57 |                 _ => b"_\n\0",
   |                      ^^^^^^^^
   |
   = note: delayed at compiler/rustc_const_eval/src/transform/validate.rs:119:36

error: internal compiler error: broken MIR in Item(WithOptConstParam { did: DefId(0:19 ~ condition[1c5b]::main), const_param_did: None }) (after pass RemoveNoopLandingPads) at bb0[0]:
                                `Operand::Copy` with non-`Copy` type isize
  --> ./compiler/rustc_codegen_gcc/tests/run/condition.rs:55:13
   |
55 |             match argc {
   |             ^^^^^^^^^^
   |
   = note: delayed at compiler/rustc_const_eval/src/transform/validate.rs:119:36

error: internal compiler error: broken MIR in Item(WithOptConstParam { did: DefId(0:19 ~ condition[1c5b]::main), const_param_did: None }) (after pass RemoveNoopLandingPads) at bb1[1]:
                                `Operand::Copy` with non-`Copy` type &[u8; 3]
  --> ./compiler/rustc_codegen_gcc/tests/run/condition.rs:57:22
   |
57 |                 _ => b"_\n\0",
   |                      ^^^^^^^^
   |
   = note: delayed at compiler/rustc_const_eval/src/transform/validate.rs:119:36

error: internal compiler error: broken MIR in Item(WithOptConstParam { did: DefId(0:19 ~ condition[1c5b]::main), const_param_did: None }) (after pass SimplifyCfg-final) at bb0[0]:
                                `Operand::Copy` with non-`Copy` type isize
  --> ./compiler/rustc_codegen_gcc/tests/run/condition.rs:55:13
   |
55 |             match argc {
   |             ^^^^^^^^^^
   |
   = note: delayed at compiler/rustc_const_eval/src/transform/validate.rs:119:36

error: internal compiler error: broken MIR in Item(WithOptConstParam { did: DefId(0:19 ~ condition[1c5b]::main), const_param_did: None }) (after pass SimplifyCfg-final) at bb1[1]:
                                `Operand::Copy` with non-`Copy` type &[u8; 3]
  --> ./compiler/rustc_codegen_gcc/tests/run/condition.rs:57:22
   |
57 |                 _ => b"_\n\0",
   |                      ^^^^^^^^
   |
   = note: delayed at compiler/rustc_const_eval/src/transform/validate.rs:119:36

error: internal compiler error: broken MIR in Item(WithOptConstParam { did: DefId(0:19 ~ condition[1c5b]::main), const_param_did: None }) (after pass RenameReturnPlace) at bb0[0]:
                                `Operand::Copy` with non-`Copy` type isize
  --> ./compiler/rustc_codegen_gcc/tests/run/condition.rs:55:13
   |
55 |             match argc {
   |             ^^^^^^^^^^
   |
   = note: delayed at compiler/rustc_const_eval/src/transform/validate.rs:119:36

error: internal compiler error: broken MIR in Item(WithOptConstParam { did: DefId(0:19 ~ condition[1c5b]::main), const_param_did: None }) (after pass RenameReturnPlace) at bb1[1]:
                                `Operand::Copy` with non-`Copy` type &[u8; 3]
  --> ./compiler/rustc_codegen_gcc/tests/run/condition.rs:57:22
   |
57 |                 _ => b"_\n\0",
   |                      ^^^^^^^^
   |
   = note: delayed at compiler/rustc_const_eval/src/transform/validate.rs:119:36

error: internal compiler error: broken MIR in Item(WithOptConstParam { did: DefId(0:19 ~ condition[1c5b]::main), const_param_did: None }) (after pass SimplifyLocals) at bb0[0]:
                                `Operand::Copy` with non-`Copy` type isize
  --> ./compiler/rustc_codegen_gcc/tests/run/condition.rs:55:13
   |
55 |             match argc {
   |             ^^^^^^^^^^
   |
   = note: delayed at compiler/rustc_const_eval/src/transform/validate.rs:119:36

error: internal compiler error: broken MIR in Item(WithOptConstParam { did: DefId(0:19 ~ condition[1c5b]::main), const_param_did: None }) (after pass SimplifyLocals) at bb1[1]:
                                `Operand::Copy` with non-`Copy` type &[u8; 3]
  --> ./compiler/rustc_codegen_gcc/tests/run/condition.rs:57:22
   |
57 |                 _ => b"_\n\0",
   |                      ^^^^^^^^
   |
   = note: delayed at compiler/rustc_const_eval/src/transform/validate.rs:119:36

error: internal compiler error: broken MIR in Item(WithOptConstParam { did: DefId(0:19 ~ condition[1c5b]::main), const_param_did: None }) (after pass AddCallGuards) at bb0[0]:
                                `Operand::Copy` with non-`Copy` type isize
  --> ./compiler/rustc_codegen_gcc/tests/run/condition.rs:55:13
   |
55 |             match argc {
   |             ^^^^^^^^^^
   |
   = note: delayed at compiler/rustc_const_eval/src/transform/validate.rs:119:36

error: internal compiler error: broken MIR in Item(WithOptConstParam { did: DefId(0:19 ~ condition[1c5b]::main), const_param_did: None }) (after pass AddCallGuards) at bb1[1]:
                                `Operand::Copy` with non-`Copy` type &[u8; 3]
  --> ./compiler/rustc_codegen_gcc/tests/run/condition.rs:57:22
   |
57 |                 _ => b"_\n\0",
   |                      ^^^^^^^^
   |
   = note: delayed at compiler/rustc_const_eval/src/transform/validate.rs:119:36

error: internal compiler error: broken MIR in Item(WithOptConstParam { did: DefId(0:19 ~ condition[1c5b]::main), const_param_did: None }) (after pass PhaseChange-Optimization) at bb0[0]:
                                `Operand::Copy` with non-`Copy` type isize
  --> ./compiler/rustc_codegen_gcc/tests/run/condition.rs:55:13
   |
55 |             match argc {
   |             ^^^^^^^^^^
   |
   = note: delayed at compiler/rustc_const_eval/src/transform/validate.rs:119:36

error: internal compiler error: broken MIR in Item(WithOptConstParam { did: DefId(0:19 ~ condition[1c5b]::main), const_param_did: None }) (after pass PhaseChange-Optimization) at bb1[1]:
                                `Operand::Copy` with non-`Copy` type &[u8; 3]
  --> ./compiler/rustc_codegen_gcc/tests/run/condition.rs:57:22
   |
57 |                 _ => b"_\n\0",
   |                      ^^^^^^^^
   |
   = note: delayed at compiler/rustc_const_eval/src/transform/validate.rs:119:36

error: internal compiler error: broken MIR in Item(WithOptConstParam { did: DefId(0:19 ~ condition[1c5b]::main), const_param_did: None }) (after pass PreCodegen) at bb0[0]:
                                `Operand::Copy` with non-`Copy` type isize
  --> ./compiler/rustc_codegen_gcc/tests/run/condition.rs:55:13
   |
55 |             match argc {
   |             ^^^^^^^^^^
   |
   = note: delayed at compiler/rustc_const_eval/src/transform/validate.rs:119:36

error: internal compiler error: broken MIR in Item(WithOptConstParam { did: DefId(0:19 ~ condition[1c5b]::main), const_param_did: None }) (after pass PreCodegen) at bb1[1]:
                                `Operand::Copy` with non-`Copy` type &[u8; 3]
  --> ./compiler/rustc_codegen_gcc/tests/run/condition.rs:57:22
   |
57 |                 _ => b"_\n\0",
   |                      ^^^^^^^^
   |
   = note: delayed at compiler/rustc_const_eval/src/transform/validate.rs:119:36

error: internal compiler error: broken MIR in Item(WithOptConstParam { did: DefId(0:19 ~ condition[1c5b]::main), const_param_did: None }) (end of phase transition to Optimization) at bb0[0]:
                                `Operand::Copy` with non-`Copy` type isize
  --> ./compiler/rustc_codegen_gcc/tests/run/condition.rs:55:13
   |
55 |             match argc {
   |             ^^^^^^^^^^
   |
   = note: delayed at compiler/rustc_const_eval/src/transform/validate.rs:119:36

error: internal compiler error: broken MIR in Item(WithOptConstParam { did: DefId(0:19 ~ condition[1c5b]::main), const_param_did: None }) (end of phase transition to Optimization) at bb1[1]:
                                `Operand::Copy` with non-`Copy` type &[u8; 3]
  --> ./compiler/rustc_codegen_gcc/tests/run/condition.rs:57:22
   |
57 |                 _ => b"_\n\0",
   |                      ^^^^^^^^
   |
   = note: delayed at compiler/rustc_const_eval/src/transform/validate.rs:119:36

thread 'rustc' panicked at 'no errors encountered even though `delay_span_bug` issued', compiler/rustc_errors/src/lib.rs:1188:13
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.

note: we would appreciate a bug report: https://github.com/rust-lang/rust/issues/new?labels=C-bug%2C+I-ICE%2C+T-compiler&template=ice.md

note: rustc 1.59.0-nightly (c14569225 2022-01-01) running on x86_64-unknown-linux-gnu

note: compiler flags: -Z validate-mir

query stack during panic:
end of query stack
Backtrace

thread 'rustc' panicked at 'no errors encountered even though `delay_span_bug` issued', compiler/rustc_errors/src/lib.rs:1188:13
stack backtrace:
   0:     0x7fe5eb1ae9bc - std::backtrace_rs::backtrace::libunwind::trace::h65f1c9fa282ae451
                               at /rustc/c145692254e86974941f2c92c643a23df0f13e82/library/std/src/../../backtrace/src/backtrace/libunwind.rs:93:5
   1:     0x7fe5eb1ae9bc - std::backtrace_rs::backtrace::trace_unsynchronized::h48355373b51db027
                               at /rustc/c145692254e86974941f2c92c643a23df0f13e82/library/std/src/../../backtrace/src/backtrace/mod.rs:66:5
   2:     0x7fe5eb1ae9bc - std::sys_common::backtrace::_print_fmt::h90451a39c3d7ac2e
                               at /rustc/c145692254e86974941f2c92c643a23df0f13e82/library/std/src/sys_common/backtrace.rs:67:5
   3:     0x7fe5eb1ae9bc - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::hb2251b6e44ad5ebe
                               at /rustc/c145692254e86974941f2c92c643a23df0f13e82/library/std/src/sys_common/backtrace.rs:46:22
   4:     0x7fe5eb20f49c - core::fmt::write::hb63f5588b360686a
                               at /rustc/c145692254e86974941f2c92c643a23df0f13e82/library/core/src/fmt/mod.rs:1149:17
   5:     0x7fe5eb19de33 - std::io::Write::write_fmt::hb59a8c8cd2564937
                               at /rustc/c145692254e86974941f2c92c643a23df0f13e82/library/std/src/io/mod.rs:1660:15
   6:     0x7fe5eb1b2e82 - std::sys_common::backtrace::_print::h2b32d5daaf650542
                               at /rustc/c145692254e86974941f2c92c643a23df0f13e82/library/std/src/sys_common/backtrace.rs:49:5
   7:     0x7fe5eb1b2e82 - std::sys_common::backtrace::print::h8fce89e0a2361e4c
                               at /rustc/c145692254e86974941f2c92c643a23df0f13e82/library/std/src/sys_common/backtrace.rs:36:9
   8:     0x7fe5eb1b2e82 - std::panicking::default_hook::{{closure}}::hcc142fd4af601bd7
                               at /rustc/c145692254e86974941f2c92c643a23df0f13e82/library/std/src/panicking.rs:211:50
   9:     0x7fe5eb1b2a65 - std::panicking::default_hook::h3f20aebc8a7be054
                               at /rustc/c145692254e86974941f2c92c643a23df0f13e82/library/std/src/panicking.rs:228:9
  10:     0x7fe5eb94eb91 - rustc_driver[e1b155f8b28a30b9]::DEFAULT_HOOK::{closure#0}::{closure#0}
  11:     0x7fe5eb1b3635 - std::panicking::rust_panic_with_hook::hd538abff5aba1fbb
                               at /rustc/c145692254e86974941f2c92c643a23df0f13e82/library/std/src/panicking.rs:610:17
  12:     0x7fe5eb1b3330 - std::panicking::begin_panic_handler::{{closure}}::h6796463ba832d131
                               at /rustc/c145692254e86974941f2c92c643a23df0f13e82/library/std/src/panicking.rs:502:13
  13:     0x7fe5eb1aee64 - std::sys_common::backtrace::__rust_end_short_backtrace::h3ce20c3a238e7942
                               at /rustc/c145692254e86974941f2c92c643a23df0f13e82/library/std/src/sys_common/backtrace.rs:139:18
  14:     0x7fe5eb1b3069 - rust_begin_unwind
                               at /rustc/c145692254e86974941f2c92c643a23df0f13e82/library/std/src/panicking.rs:498:5
  15:     0x7fe5eb17ad31 - core::panicking::panic_fmt::h944465c5be0ff53f
                               at /rustc/c145692254e86974941f2c92c643a23df0f13e82/library/core/src/panicking.rs:107:14
  16:     0x7fe5eca33bac - core[d70f99487a0e84d5]::panicking::panic_display::<&str>
  17:     0x7fe5ee0b4a0d - <rustc_errors[9c0ded007a8c6810]::HandlerInner>::flush_delayed
  18:     0x7fe5ee0b2eed - <rustc_errors[9c0ded007a8c6810]::HandlerInner as core[d70f99487a0e84d5]::ops::drop::Drop>::drop
  19:     0x7fe5ed7aa9c6 - core[d70f99487a0e84d5]::ptr::drop_in_place::<rustc_session[1bcf79ec8fc38f2b]::parse::ParseSess>
  20:     0x7fe5ed7adbba - <alloc[523fe8aae44a10c6]::rc::Rc<rustc_session[1bcf79ec8fc38f2b]::session::Session> as core[d70f99487a0e84d5]::ops::drop::Drop>::drop
  21:     0x7fe5ed77e53c - core[d70f99487a0e84d5]::ptr::drop_in_place::<rustc_interface[1106b44aa5e86d5a]::interface::Compiler>
  22:     0x7fe5ed77ed51 - rustc_span[87e3aa93beff5ce5]::with_source_map::<core[d70f99487a0e84d5]::result::Result<(), rustc_errors[9c0ded007a8c6810]::ErrorReported>, rustc_interface[1106b44aa5e86d5a]::interface::create_compiler_and_run<core[d70f99487a0e84d5]::result::Result<(), rustc_errors[9c0ded007a8c6810]::ErrorReported>, rustc_driver[e1b155f8b28a30b9]::run_compiler::{closure#1}>::{closure#1}>
  23:     0x7fe5ed7a825e - rustc_interface[1106b44aa5e86d5a]::interface::create_compiler_and_run::<core[d70f99487a0e84d5]::result::Result<(), rustc_errors[9c0ded007a8c6810]::ErrorReported>, rustc_driver[e1b155f8b28a30b9]::run_compiler::{closure#1}>
  24:     0x7fe5ed782b32 - std[c0c17edbc27de8c5]::sys_common::backtrace::__rust_begin_short_backtrace::<rustc_interface[1106b44aa5e86d5a]::util::setup_callbacks_and_run_in_thread_pool_with_globals<rustc_interface[1106b44aa5e86d5a]::interface::run_compiler<core[d70f99487a0e84d5]::result::Result<(), rustc_errors[9c0ded007a8c6810]::ErrorReported>, rustc_driver[e1b155f8b28a30b9]::run_compiler::{closure#1}>::{closure#0}, core[d70f99487a0e84d5]::result::Result<(), rustc_errors[9c0ded007a8c6810]::ErrorReported>>::{closure#0}, core[d70f99487a0e84d5]::result::Result<(), rustc_errors[9c0ded007a8c6810]::ErrorReported>>
  25:     0x7fe5ed7acb09 - <<std[c0c17edbc27de8c5]::thread::Builder>::spawn_unchecked<rustc_interface[1106b44aa5e86d5a]::util::setup_callbacks_and_run_in_thread_pool_with_globals<rustc_interface[1106b44aa5e86d5a]::interface::run_compiler<core[d70f99487a0e84d5]::result::Result<(), rustc_errors[9c0ded007a8c6810]::ErrorReported>, rustc_driver[e1b155f8b28a30b9]::run_compiler::{closure#1}>::{closure#0}, core[d70f99487a0e84d5]::result::Result<(), rustc_errors[9c0ded007a8c6810]::ErrorReported>>::{closure#0}, core[d70f99487a0e84d5]::result::Result<(), rustc_errors[9c0ded007a8c6810]::ErrorReported>>::{closure#1} as core[d70f99487a0e84d5]::ops::function::FnOnce<()>>::call_once::{shim:vtable#0}
  26:     0x7fe5eb1beb63 - <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once::ha51db0b689e19840
                               at /rustc/c145692254e86974941f2c92c643a23df0f13e82/library/alloc/src/boxed.rs:1811:9
  27:     0x7fe5eb1beb63 - <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once::h15977bb176cdf7d1
                               at /rustc/c145692254e86974941f2c92c643a23df0f13e82/library/alloc/src/boxed.rs:1811:9
  28:     0x7fe5eb1beb63 - std::sys::unix::thread::Thread::new::thread_start::hec91ed603947ed42
                               at /rustc/c145692254e86974941f2c92c643a23df0f13e82/library/std/src/sys/unix/thread.rs:108:17
  29:     0x7fe5eb0c7259 - start_thread
  30:     0x7fe5eafe35e3 - __GI___clone
  31:                0x0 - <unknown>

error: internal compiler error: unexpected panic

note: the compiler unexpectedly panicked. this is a bug.

note: we would appreciate a bug report: https://github.com/rust-lang/rust/issues/new?labels=C-bug%2C+I-ICE%2C+T-compiler&template=ice.md

note: rustc 1.59.0-nightly (c14569225 2022-01-01) running on x86_64-unknown-linux-gnu

note: compiler flags: -Z validate-mir

query stack during panic:
end of query stack

@matthiaskrgr matthiaskrgr 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 Jan 2, 2022
@SparrowLii
Copy link
Member

SparrowLii commented Jan 4, 2022

Adding the following statements can avoid this problem:

impl Copy for isize {}
impl<T: ?Sized> Copy for &T {}

Perhaps the compiler's error handling should consider the #![no_core] situation more.

@hellow554
Copy link
Contributor

You can provoke this with only cargo check:

minimized:

#![feature(lang_items, no_core, start)]
#![no_std]
#![no_core]

#[lang = "sized"]
pub trait Sized {}

#[lang = "copy"]
trait Copy {}

#[start]
fn main(argc: isize, _argv: *const *const u8) -> isize {
    match argc {
        1 => 1,
        _ => 0,
    }
}

@rust-lang-glacier-bot rust-lang-glacier-bot added the glacier ICE tracked in rust-lang/glacier. label Jan 5, 2022
@Aaron1011
Copy link
Member

Personally, I don't think ICEs with #![no_core] are worth addressing. It's a perma-unstable feature, and lang items are effectively internal compiler code that happens to be written in a crate. We don't try to prevent ICEs in the face of modifications to the compiler itself (in fact, many internal compiler APIs will deliberately ICE when they are used incorrectly).

The only correct way to use #![no_core] is to copy-paste all of the lang items, types, and impls that you're using (and even then, leaving out "unused" ones is pretty dubious).

@MendyBerger
Copy link

Adding a playground link for reference as I have the same issue

https://play.rust-lang.org/?version=nightly&mode=debug&edition=2021&gist=44a20adc93ce548c2d41b1d53b764ccb

@matthiaskrgr
Copy link
Member Author

🤔 looks like this is fixed with rustc 1.62.0-nightly (de1026a67 2022-04-23)

@matthiaskrgr matthiaskrgr added the E-needs-test Call for participation: An issue has been fixed and does not reproduce, but no test has been added. label Apr 24, 2022
@matthiaskrgr
Copy link
Member Author

maybe fixed by #93970 or #96281

@MendyBerger
Copy link

@matthiaskrgr still getting an internal compiler error in playground

@matthiaskrgr
Copy link
Member Author

oh hmm, I see. Not sure what I tested in the morning then... 😄

@matthiaskrgr matthiaskrgr removed the E-needs-test Call for participation: An issue has been fixed and does not reproduce, but no test has been added. label Apr 24, 2022
@matthiaskrgr
Copy link
Member Author

But it looks like the ICE changed a bit, from many

error: internal compiler error: broken MIR in Item(WithOptConstParam { did: DefId(0:19 ~ condition[1c5b]::main), const_param_did: None }) (after pass SimplifyCfg-initial) at bb0[2]:
                                `Operand::Copy` with non-`Copy` type isize

to

error: internal compiler error: no errors encountered even though `delay_span_bug` issued

error: internal compiler error: broken MIR in DefId(0:19 ~ bad[1af5]::main) (NoSolution): could not prove Binder(TraitPredicate(<isize as Copy>, polarity:Positive), [])
  |
  = note: delayed at compiler/rustc_borrowck/src/type_check/canonical.rs:149:13

thread 'rustc' panicked at 'Box<dyn Any>', compiler/rustc_errors/src/lib.rs:1347:13
stack backtrace:
   0:     0x7fd8bc29defd - std::backtrace_rs::backtrace::libunwind::trace::h8b2f13ca15763657
                               at /rustc/b21759f5509477522a208b27bec5822d89f7c6b8/library/std/src/../../backtrace/src/backtrace/libunwind.rs:93:5
   1:     0x7fd8bc29defd - std::backtrace_rs::backtrace::trace_unsynchronized::h27431a03bc396c35
                               at /rustc/b21759f5509477522a208b27bec5822d89f7c6b8/library/std/src/../../backtrace/src/backtrace/mod.rs:66:5
   2:     0x7fd8bc29defd - std::sys_common::backtrace::_print_fmt::h85c4be4815ee95d0
                               at /rustc/b21759f5509477522a208b27bec5822d89f7c6b8/library/std/src/sys_common/backtrace.rs:66:5
   3:     0x7fd8bc29defd - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::hb4d052801e236c20
                               at /rustc/b21759f5509477522a208b27bec5822d89f7c6b8/library/std/src/sys_common/backtrace.rs:45:22
   4:     0x7fd8bc2f9c7c - core::fmt::write::h2baa2cf7fbb66648
                               at /rustc/b21759f5509477522a208b27bec5822d89f7c6b8/library/core/src/fmt/mod.rs:1194:17
   5:     0x7fd8bc28f691 - std::io::Write::write_fmt::hee014219a0480f85
                               at /rustc/b21759f5509477522a208b27bec5822d89f7c6b8/library/std/src/io/mod.rs:1655:15
   6:     0x7fd8bc2a0c15 - std::sys_common::backtrace::_print::h16e6cb4501e5ce4b
                               at /rustc/b21759f5509477522a208b27bec5822d89f7c6b8/library/std/src/sys_common/backtrace.rs:48:5
   7:     0x7fd8bc2a0c15 - std::sys_common::backtrace::print::h3b91c0a9f6fba3d1
                               at /rustc/b21759f5509477522a208b27bec5822d89f7c6b8/library/std/src/sys_common/backtrace.rs:35:9
   8:     0x7fd8bc2a0c15 - std::panicking::default_hook::{{closure}}::he9e05bbbc618627c
                               at /rustc/b21759f5509477522a208b27bec5822d89f7c6b8/library/std/src/panicking.rs:295:22
   9:     0x7fd8bc2a0889 - std::panicking::default_hook::hc1d2a0dd98be282b
                               at /rustc/b21759f5509477522a208b27bec5822d89f7c6b8/library/std/src/panicking.rs:314:9
  10:     0x7fd8bcacc4d1 - rustc_driver[c5504433ef6ae1e]::DEFAULT_HOOK::{closure#0}::{closure#0}
  11:     0x7fd8bc2a13e6 - std::panicking::rust_panic_with_hook::h4f74f0cdd6986440
                               at /rustc/b21759f5509477522a208b27bec5822d89f7c6b8/library/std/src/panicking.rs:702:17
  12:     0x7fd8bdc10b01 - std[2512581f16bcafad]::panicking::begin_panic::<rustc_errors[35505590feeea3b9]::ExplicitBug>::{closure#0}
  13:     0x7fd8bdc0f9d6 - std[2512581f16bcafad]::sys_common::backtrace::__rust_end_short_backtrace::<std[2512581f16bcafad]::panicking::begin_panic<rustc_errors[35505590feeea3b9]::ExplicitBug>::{closure#0}, !>
  14:     0x7fd8bdc2807f - std[2512581f16bcafad]::panicking::begin_panic::<rustc_errors[35505590feeea3b9]::ExplicitBug>
  15:     0x7fd8bdc24d36 - std[2512581f16bcafad]::panic::panic_any::<rustc_errors[35505590feeea3b9]::ExplicitBug>
  16:     0x7fd8bf3cc097 - <rustc_errors[35505590feeea3b9]::HandlerInner as core[4c7b0892081a9ca1]::ops::drop::Drop>::drop
  17:     0x7fd8beb0bf68 - core[4c7b0892081a9ca1]::ptr::drop_in_place::<rustc_session[730db1894ed7a625]::parse::ParseSess>
  18:     0x7fd8beb0e873 - <alloc[f70441f5864a1b32]::rc::Rc<rustc_session[730db1894ed7a625]::session::Session> as core[4c7b0892081a9ca1]::ops::drop::Drop>::drop
  19:     0x7fd8beb0b5ed - core[4c7b0892081a9ca1]::ptr::drop_in_place::<rustc_interface[cc3c07523dc95d8e]::interface::Compiler>
  20:     0x7fd8beb0aee4 - rustc_span[a90ae992492d00db]::with_source_map::<core[4c7b0892081a9ca1]::result::Result<(), rustc_errors[35505590feeea3b9]::ErrorGuaranteed>, rustc_interface[cc3c07523dc95d8e]::interface::create_compiler_and_run<core[4c7b0892081a9ca1]::result::Result<(), rustc_errors[35505590feeea3b9]::ErrorGuaranteed>, rustc_driver[c5504433ef6ae1e]::run_compiler::{closure#1}>::{closure#1}>
  21:     0x7fd8beaf4c94 - rustc_interface[cc3c07523dc95d8e]::interface::create_compiler_and_run::<core[4c7b0892081a9ca1]::result::Result<(), rustc_errors[35505590feeea3b9]::ErrorGuaranteed>, rustc_driver[c5504433ef6ae1e]::run_compiler::{closure#1}>
  22:     0x7fd8beade8d1 - <scoped_tls[59d43b406989f98d]::ScopedKey<rustc_span[a90ae992492d00db]::SessionGlobals>>::set::<rustc_interface[cc3c07523dc95d8e]::interface::run_compiler<core[4c7b0892081a9ca1]::result::Result<(), rustc_errors[35505590feeea3b9]::ErrorGuaranteed>, rustc_driver[c5504433ef6ae1e]::run_compiler::{closure#1}>::{closure#0}, core[4c7b0892081a9ca1]::result::Result<(), rustc_errors[35505590feeea3b9]::ErrorGuaranteed>>
  23:     0x7fd8beaf7e6f - std[2512581f16bcafad]::sys_common::backtrace::__rust_begin_short_backtrace::<rustc_interface[cc3c07523dc95d8e]::util::run_in_thread_pool_with_globals<rustc_interface[cc3c07523dc95d8e]::interface::run_compiler<core[4c7b0892081a9ca1]::result::Result<(), rustc_errors[35505590feeea3b9]::ErrorGuaranteed>, rustc_driver[c5504433ef6ae1e]::run_compiler::{closure#1}>::{closure#0}, core[4c7b0892081a9ca1]::result::Result<(), rustc_errors[35505590feeea3b9]::ErrorGuaranteed>>::{closure#0}, core[4c7b0892081a9ca1]::result::Result<(), rustc_errors[35505590feeea3b9]::ErrorGuaranteed>>
  24:     0x7fd8beaf7fb9 - <<std[2512581f16bcafad]::thread::Builder>::spawn_unchecked_<rustc_interface[cc3c07523dc95d8e]::util::run_in_thread_pool_with_globals<rustc_interface[cc3c07523dc95d8e]::interface::run_compiler<core[4c7b0892081a9ca1]::result::Result<(), rustc_errors[35505590feeea3b9]::ErrorGuaranteed>, rustc_driver[c5504433ef6ae1e]::run_compiler::{closure#1}>::{closure#0}, core[4c7b0892081a9ca1]::result::Result<(), rustc_errors[35505590feeea3b9]::ErrorGuaranteed>>::{closure#0}, core[4c7b0892081a9ca1]::result::Result<(), rustc_errors[35505590feeea3b9]::ErrorGuaranteed>>::{closure#1} as core[4c7b0892081a9ca1]::ops::function::FnOnce<()>>::call_once::{shim:vtable#0}
  25:     0x7fd8bc2ab333 - <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once::hb7ad772b378c0600
                               at /rustc/b21759f5509477522a208b27bec5822d89f7c6b8/library/alloc/src/boxed.rs:1866:9
  26:     0x7fd8bc2ab333 - <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once::h4f8a3b9480e6ce6e
                               at /rustc/b21759f5509477522a208b27bec5822d89f7c6b8/library/alloc/src/boxed.rs:1866:9
  27:     0x7fd8bc2ab333 - std::sys::unix::thread::Thread::new::thread_start::h2cc17b2e6ab55627
                               at /rustc/b21759f5509477522a208b27bec5822d89f7c6b8/library/std/src/sys/unix/thread.rs:108:17
  28:     0x7fd8bc0835c2 - start_thread
  29:     0x7fd8bc108584 - __clone
  30:                0x0 - <unknown>

note: the compiler unexpectedly panicked. this is a bug.

note: we would appreciate a bug report: https://github.com/rust-lang/rust/issues/new?labels=C-bug%2C+I-ICE%2C+T-compiler&template=ice.md

note: rustc 1.62.0-nightly (b21759f55 2022-04-24) running on x86_64-unknown-linux-gnu

query stack during panic:
end of query stack

@JohnTitor
Copy link
Member

Fixed on the latest nightly, marking as E-needs-test
@rustbot labels: +E-needs-test

@rustbot rustbot added the E-needs-test Call for participation: An issue has been fixed and does not reproduce, but no test has been added. label Oct 15, 2023
@MendyBerger
Copy link

FWIW I've tested this with the latest nightly, had to add #[rustc_safe_intrinsic], and now getting a new ICE.

https://play.rust-lang.org/?version=nightly&mode=debug&edition=2021&gist=0a5577c9495a5f29bf2d097de6675206

Might be related to #107440

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. E-needs-test Call for participation: An issue has been fixed and does not reproduce, but no test has been added. glacier ICE tracked in rust-lang/glacier. 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.
Projects
None yet
Development

No branches or pull requests

8 participants