Skip to content

Existential type can have inconsistent concrete type #52632

Closed
@dtolnay

Description

#![feature(existential_type)]

use std::fmt::Debug;

// Parser workaround. https://github.com/rust-lang/rust/issues/52631
macro_rules! this_is_an_item {
    ($i:item) => { $i };
}

fn main() {
    this_is_an_item! {
        existential type Existential: Debug;
    }

    fn _unused() -> Existential { String::new() }

    let null = || -> Existential { 0 };
    println!("{:?}", null());
}
Segmentation fault (core dumped)

Mentioning the existential types tracking issue #34511
Mentioning @oli-obk and @cramertj

Metadata

Assignees

Labels

A-impl-traitArea: `impl Trait`. Universally / existentially quantified anonymous types with static dispatch.C-bugCategory: This is a bug.F-type_alias_impl_trait`#[feature(type_alias_impl_trait)]`I-ICEIssue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.requires-nightlyThis issue requires a nightly compiler in some way.

Type

No type

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions