]> git.lizzy.rs Git - rust.git/blob - src/test/rustdoc/synthetic_auto/complex.rs
Sort synthetic impls bounds before rendering
[rust.git] / src / test / rustdoc / synthetic_auto / complex.rs
1 // Copyright 2018 The Rust Project Developers. See the COPYRIGHT
2 // file at the top-level directory of this distribution and at
3 // http://rust-lang.org/COPYRIGHT.
4 //
5 // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
6 // http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
7 // <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
8 // option. This file may not be copied, modified, or distributed
9 // except according to those terms.
10
11 mod foo {
12     pub trait MyTrait<'a> {
13         type MyItem: ?Sized;
14     }
15
16     pub struct Inner<'a, Q, R: ?Sized> {
17         field: Q,
18         field3: &'a u8,
19         my_foo: Foo<Q>,
20         field2: R,
21     }
22
23     pub struct Outer<'a, T, K: ?Sized> {
24         my_inner: Inner<'a, T, K>,
25     }
26
27     pub struct Foo<T> {
28         myfield: T,
29     }
30 }
31
32 // @has complex/struct.NotOuter.html
33 // @has - '//*[@id="synthetic-implementations-list"]/*[@class="impl"]/*/code' "impl<'a, T, K: \
34 // ?Sized> Send for NotOuter<'a, T, K> where K: for<'b> Fn((&'b bool, &'a u8)) \
35 // -> &'b i8, T: MyTrait<'a>, <T as MyTrait<'a>>::MyItem: Copy, 'a: 'static"
36
37 pub use foo::{Foo, Inner as NotInner, MyTrait as NotMyTrait, Outer as NotOuter};
38
39 unsafe impl<T> Send for Foo<T>
40 where
41     T: NotMyTrait<'static>,
42 {
43 }
44
45 unsafe impl<'a, Q, R: ?Sized> Send for NotInner<'a, Q, R>
46 where
47     Q: NotMyTrait<'a>,
48     <Q as NotMyTrait<'a>>::MyItem: Copy,
49     R: for<'b> Fn((&'b bool, &'a u8)) -> &'b i8,
50     Foo<Q>: Send,
51 {
52 }