Skip to content

repeated TAIT doesn't detect lifetime conflict #86465

Description

@nikomatsakis

This code compiles, but it should not:

#![feature(min_type_alias_impl_trait)]

type X<'a, 'b> = impl std::fmt::Debug;

fn f<'t, 'u>(a: &'t u32, b: &'u u32) -> (X<'t, 'u>, X<'u, 't>) {
    (a, a)
}

The function creates two constraints:

  • X<'t, 'u> = &'t u32, which means type X<'a, 'b> = &'a u32
  • X<'u, 't> = &'t u32, which means type X<'a, 'b> = &'b u32

These should not both be satisfiable!

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

A-trait-systemArea: Trait systemC-bugCategory: This is a bug.T-compilerRelevant to the compiler 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