Skip to content

Commit 96a5348

Browse files
authored
Rollup merge of #122949 - ShoyuVanilla:issue-117310, r=lcnr
Add a regression test for #117310 Closes #117310 It seems to have been fixed in `rustc 1.79.0-nightly (1388d7a 2024-03-20)` or before, so just adding a regression test for it.
2 parents 19d3827 + 37dbe40 commit 96a5348

File tree

1 file changed

+28
-0
lines changed

1 file changed

+28
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
//@ check-pass
2+
3+
#![feature(type_alias_impl_trait)]
4+
#![allow(dead_code)]
5+
6+
use std::ops::Deref;
7+
8+
trait Trait {}
9+
impl<A, B> Trait for (A, B, u8) where A: Deref, B: Deref<Target = A::Target>, {}
10+
impl<A, B> Trait for (A, B, i8) {}
11+
12+
type TaitSized = impl Sized;
13+
fn def_tait1() -> TaitSized {}
14+
15+
type TaitCopy = impl Copy;
16+
fn def_tait2() -> TaitCopy {}
17+
18+
fn impl_trait<T: Trait> () {}
19+
20+
fn test() {
21+
impl_trait::<(&TaitSized, &TaitCopy, _)>();
22+
impl_trait::<(&TaitCopy, &TaitSized, _)>();
23+
24+
impl_trait::<(&TaitCopy, &String, _)>();
25+
impl_trait::<(&TaitSized, &String, _)>();
26+
}
27+
28+
fn main() {}

0 commit comments

Comments
 (0)