Skip to content

NR2: ICE when trying to compile enums with non-const discriminants. #3689

Open
@sakupan102

Description

@sakupan102

Related Issue

#3635

Code

fn main() {
    let y = 3;
    enum Foo {
        Bar = y,
        // { dg-error "cannot find value .y. in this scope" "" { target *-*-* } .-1 }
    }
}

Error output

test.rs:4:11: error: cannot find value 'y' in this scope [E0425]
    4 |     Bar = y,
      |           ^
crab1: internal compiler error: Segmentation fault
0x12fcf03 crash_signal
        ../../gccrs/gcc/toplev.cc:319
0xb7cc00 Rust::TyTy::VariantDef::as_string[abi:cxx11]() const
        ../../gccrs/gcc/rust/typecheck/rust-tyty.cc:1541
0xb7cf6b Rust::TyTy::ADTType::as_string[abi:cxx11]() const
        ../../gccrs/gcc/rust/typecheck/rust-tyty.cc:1677
0xb9958b Rust::TyTy::VarianceAnalysis::GenericTyVisitorCtx::process_type(Rust::TyTy::ADTType&)
        ../../gccrs/gcc/rust/typecheck/rust-tyty-variance-analysis.cc:236
0xb997b3 Rust::TyTy::VarianceAnalysis::GenericTyPerCrateCtx::process_type(Rust::TyTy::ADTType&)
        ../../gccrs/gcc/rust/typecheck/rust-tyty-variance-analysis.cc:131
0xbb8ff7 Rust::Resolver::TypeCheckItem::visit(Rust::HIR::Enum&)
        ../../gccrs/gcc/rust/typecheck/rust-hir-type-check-item.cc:391
0xbb3d5b Rust::Resolver::TypeCheckItem::Resolve(Rust::HIR::Item&)
        ../../gccrs/gcc/rust/typecheck/rust-hir-type-check-item.cc:59
0xbb3d5b Rust::Resolver::TypeCheckItem::Resolve(Rust::HIR::Item&)
        ../../gccrs/gcc/rust/typecheck/rust-hir-type-check-item.cc:45

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    Projects

    Status

    Todo

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions