Skip to content

ICE - Option Refcount causes an LLVM assertion to fail. #21533

Closed
@DavidJFelix

Description

@DavidJFelix

The following code:

use std::rc::Rc

struct ProblemType {
    children [Option<Rc<ProblemType>>; 8],
}

impl ProblemType {
    fn breaks_compiler() -> Option<Rc<ProblemType>> {
        None
    }
}

Causes LLVM to fail an assertion, claiming:

rustc: /home/rustbuild/src/rust-buildbot/slave/nightly-dist-rustc-linux/build/src/llvm/lib/IR/DataLayout.cpp:636: unsigned int llvm::DataLayout::getAlignment(llvm::Type*, bool) const: Assertion `Ty->isSized() && "Cannot getTypeInfo() on a type that is unsized!"' failed.

Metadata

Metadata

Assignees

No one assigned

    Labels

    I-ICEIssue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions