test: add test for #4257
This commit is contained in:
parent
d19f69cd71
commit
33d1368674
13
tests/source/issue_4257.rs
Normal file
13
tests/source/issue_4257.rs
Normal file
@ -0,0 +1,13 @@
|
||||
#![feature(generic_associated_types)]
|
||||
#![allow(incomplete_features)]
|
||||
|
||||
trait Trait<T> {
|
||||
type Type<'a> where T: 'a;
|
||||
fn foo(x: &T) -> Self::Type<'_>;
|
||||
}
|
||||
impl<T> Trait<T> for () {
|
||||
type Type<'a> where T: 'a = &'a T;
|
||||
fn foo(x: &T) -> Self::Type<'_> {
|
||||
x
|
||||
}
|
||||
}
|
18
tests/target/issue_4257.rs
Normal file
18
tests/target/issue_4257.rs
Normal file
@ -0,0 +1,18 @@
|
||||
#![feature(generic_associated_types)]
|
||||
#![allow(incomplete_features)]
|
||||
|
||||
trait Trait<T> {
|
||||
type Type<'a>
|
||||
where
|
||||
T: 'a;
|
||||
fn foo(x: &T) -> Self::Type<'_>;
|
||||
}
|
||||
impl<T> Trait<T> for () {
|
||||
type Type<'a>
|
||||
where
|
||||
T: 'a,
|
||||
= &'a T;
|
||||
fn foo(x: &T) -> Self::Type<'_> {
|
||||
x
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user