]> git.lizzy.rs Git - rust.git/blob - tests/rustdoc/issue-60726.rs
Rollup merge of #107769 - compiler-errors:pointer-like, r=eholk
[rust.git] / tests / rustdoc / issue-60726.rs
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
29 // @has - '//*[@id="synthetic-implementations-list"]//*[@class="impl"]//h3[@class="code-header"]' \
30 // "impl<T> !Send for IntoIter<T>"
31 // @has - '//*[@id="synthetic-implementations-list"]//*[@class="impl"]//h3[@class="code-header"]' \
32 // "impl<T> !Sync for IntoIter<T>"
33 pub struct IntoIter<T>{
34     hello:DynTrait<FooInterface<T>>,
35 }