Skip to content

Commit

Permalink
Add a regression test for #117310
Browse files Browse the repository at this point in the history
  • Loading branch information
ShoyuVanilla committed Mar 23, 2024
1 parent c3b05c6 commit 37dbe40
Showing 1 changed file with 28 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
//@ check-pass

#![feature(type_alias_impl_trait)]
#![allow(dead_code)]

use std::ops::Deref;

trait Trait {}
impl<A, B> Trait for (A, B, u8) where A: Deref, B: Deref<Target = A::Target>, {}
impl<A, B> Trait for (A, B, i8) {}

type TaitSized = impl Sized;
fn def_tait1() -> TaitSized {}

type TaitCopy = impl Copy;
fn def_tait2() -> TaitCopy {}

fn impl_trait<T: Trait> () {}

fn test() {
impl_trait::<(&TaitSized, &TaitCopy, _)>();
impl_trait::<(&TaitCopy, &TaitSized, _)>();

impl_trait::<(&TaitCopy, &String, _)>();
impl_trait::<(&TaitSized, &String, _)>();
}

fn main() {}

0 comments on commit 37dbe40

Please sign in to comment.