Skip to content

TAITs with different args incorrectly assumed to be equal #122876

Closed
@aliemjay

Description

@aliemjay

The following should not compile. Adapted from #115017.

#![feature(type_alias_impl_trait)]

type Opaque<'a> = impl Sized;

fn get_one<'a>(a: *mut &'a str) -> Opaque<'a> {
    a
}

fn get_iter<'a>() -> impl IntoIterator<Item = Opaque<'a>> {
    None::<Opaque<'static>>
}

This is a quick issue, I did not have the chance to look into it deeper but I guess it affects ATPIT as well.
cc @compiler-errors @oli-obk

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-bugCategory: This is a bug.F-impl_trait_in_assoc_type`#![feature(impl_trait_in_assoc_type)]`F-type_alias_impl_trait`#[feature(type_alias_impl_trait)]`T-typesRelevant to the types team, which will review and decide on the PR/issue.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions