Add a regression test for issue-65581
This commit is contained in:
parent
ebc1f89ecf
commit
3a4fe97052
1 changed files with 33 additions and 0 deletions
33
src/test/ui/impl-trait/issues/issue-65581.rs
Normal file
33
src/test/ui/impl-trait/issues/issue-65581.rs
Normal file
|
|
@ -0,0 +1,33 @@
|
|||
// check-pass
|
||||
|
||||
#![allow(dead_code)]
|
||||
|
||||
trait Trait1<T, U> {
|
||||
fn f1(self) -> U;
|
||||
}
|
||||
|
||||
trait Trait2 {
|
||||
type T;
|
||||
type U: Trait2<T = Self::T>;
|
||||
fn f2(f: impl FnOnce(&Self::U));
|
||||
}
|
||||
|
||||
fn f3<T: Trait2>() -> impl Trait1<T, T::T> {
|
||||
Struct1
|
||||
}
|
||||
|
||||
struct Struct1;
|
||||
|
||||
impl<T: Trait2> Trait1<T, T::T> for Struct1 {
|
||||
fn f1(self) -> T::T {
|
||||
unimplemented!()
|
||||
}
|
||||
}
|
||||
|
||||
fn f4<T: Trait2>() {
|
||||
T::f2(|_| {
|
||||
f3::<T::U>().f1();
|
||||
});
|
||||
}
|
||||
|
||||
fn main() {}
|
||||
Loading…
Add table
Add a link
Reference in a new issue