Skip to content

ICE: expected type differs from actual type #125842

Closed
@matthiaskrgr

Description

@matthiaskrgr

Code

enum TestOption<T> {
    TestSome(T),
    TestSome(),
}

pub struct Request {
    bar: TestOption<u64>,
    bar: u8,
}

fn default_instance() -> &'static Request {
    static instance: Request = Request { bar: 17 };
    &instance
}

pub fn main() {}

Meta

rustc --version --verbose:

<version>

Error output

<output>

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-const-evalArea: Constant evaluation, covers all const contexts (static, const fn, ...)C-bugCategory: This is a bug.I-ICEIssue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️S-has-mcveStatus: A Minimal Complete and Verifiable Example has been found for this issueT-compilerRelevant to the compiler team, which will review and decide on the PR/issue.requires-debug-assertionsThis issue requires a build of rustc or tooling with debug-assertions in some way

    Type

    No type

    Projects

    Status

    Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions