]> git.lizzy.rs Git - rust.git/blob - src/test/ui/generic-associated-types/issue-93141.rs
Auto merge of #99612 - yanchen4791:issue-95079-fix, r=compiler-errors
[rust.git] / src / test / ui / generic-associated-types / issue-93141.rs
1 // check-pass
2
3 #![feature(generic_associated_types)]
4
5 pub trait Fooey: Sized {
6     type Context<'c> where Self: 'c;
7 }
8
9 pub struct Handle<E: Fooey>(Option<Box<dyn for<'c> Fn(&mut E::Context<'c>)>>);
10
11 fn tuple<T>() -> (Option<T>,) { (Option::None,) }
12
13 pub struct FooImpl {}
14 impl Fooey for FooImpl {
15     type Context<'c> = &'c ();
16 }
17
18 impl FooImpl {
19     pub fn fail1() -> Handle<Self> {
20         let (tx,) = tuple();
21         Handle(tx)
22     }
23 }
24
25 fn main() {}