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