Skip to content

repeated TAIT doesn't detect lifetime conflict #86465

Closed
@nikomatsakis

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!

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.WG-traitsWorking group: Traits, https://internals.rust-lang.org/t/announcing-traits-working-group/6804

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions