]>
Commit | Line | Data |
---|---|---|
dc9dc135 XL |
1 | use std::marker::PhantomData; |
2 | ||
3 | pub struct True; | |
4 | pub struct False; | |
5 | ||
6 | pub trait InterfaceType{ | |
7 | type Send; | |
8 | } | |
9 | ||
10 | ||
11 | pub struct FooInterface<T>(PhantomData<fn()->T>); | |
12 | ||
13 | impl<T> InterfaceType for FooInterface<T> { | |
14 | type Send=False; | |
15 | } | |
16 | ||
17 | ||
18 | pub struct DynTrait<I>{ | |
19 | _interface:PhantomData<fn()->I>, | |
20 | _unsync_unsend:PhantomData<::std::rc::Rc<()>>, | |
21 | } | |
22 | ||
23 | unsafe impl<I> Send for DynTrait<I> | |
24 | where | |
25 | I:InterfaceType<Send=True> | |
26 | {} | |
27 | ||
28 | // @has issue_60726/struct.IntoIter.html | |
cdc7bbd5 | 29 | // @has - '//*[@id="synthetic-implementations-list"]//*[@class="impl"]//code' "impl<T> !Send for \ |
dc9dc135 | 30 | // IntoIter<T>" |
cdc7bbd5 | 31 | // @has - '//*[@id="synthetic-implementations-list"]//*[@class="impl"]//code' "impl<T> !Sync for \ |
dc9dc135 XL |
32 | // IntoIter<T>" |
33 | pub struct IntoIter<T>{ | |
34 | hello:DynTrait<FooInterface<T>>, | |
35 | } |