Skip to content

Commit 33d1368

Browse files
cowboy-bebugcalebcartwright
authored andcommitted
test: add test for rust-lang#4257
1 parent d19f69c commit 33d1368

File tree

2 files changed

+31
-0
lines changed

2 files changed

+31
-0
lines changed

tests/source/issue_4257.rs

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
#![feature(generic_associated_types)]
2+
#![allow(incomplete_features)]
3+
4+
trait Trait<T> {
5+
type Type<'a> where T: 'a;
6+
fn foo(x: &T) -> Self::Type<'_>;
7+
}
8+
impl<T> Trait<T> for () {
9+
type Type<'a> where T: 'a = &'a T;
10+
fn foo(x: &T) -> Self::Type<'_> {
11+
x
12+
}
13+
}

tests/target/issue_4257.rs

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
#![feature(generic_associated_types)]
2+
#![allow(incomplete_features)]
3+
4+
trait Trait<T> {
5+
type Type<'a>
6+
where
7+
T: 'a;
8+
fn foo(x: &T) -> Self::Type<'_>;
9+
}
10+
impl<T> Trait<T> for () {
11+
type Type<'a>
12+
where
13+
T: 'a,
14+
= &'a T;
15+
fn foo(x: &T) -> Self::Type<'_> {
16+
x
17+
}
18+
}

0 commit comments

Comments
 (0)