Skip to content

regression when relating two opaque types in canonical queries #116877

Closed
@aliemjay

Description

@aliemjay

Each revision of this test is an ICE in 1.75.0-nightly (2023-10-17 09df610):

// revisions: sized clone

#[cfg(sized)] fn rpit() -> impl Sized {}
#[cfg(clone)] fn rpit() -> impl Clone {}

fn same_output<Out>(_: impl Fn() -> Out, _: impl Fn() -> Out) {}

pub fn foo() -> impl Sized {
    same_output(rpit, foo);
    same_output(foo, rpit);
    rpit()
}

Both revisions have a somewhat convoluted history best shown in a table form:

sized clone
stable 1.73 PASS 🆗 ICE 🧊
#114586 (1.74.0-beta) PASS 🆗 PASS 🆗
#116530 (1.75.0-nightly) ICE 🧊 ICE 🧊

While it may seem like #116530 is the culprit, I'd argue that the PR #114586 introduced an incomplete fix that I don't believe we should commit to in stable. Additionally, reverting #114586 while keeping #116530 would fix sized version as well as an other regression #114586 (comment), making it the right choice in my opinion.

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-impl-traitArea: `impl Trait`. Universally / existentially quantified anonymous types with static dispatch.C-bugCategory: This is a bug.I-ICEIssue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️P-criticalCritical priorityT-typesRelevant to the types team, which will review and decide on the PR/issue.regression-from-stable-to-nightlyPerformance or correctness regression from stable to nightly.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions