]> git.lizzy.rs Git - rust.git/blob - src/test/rustdoc/where.rs
Rollup merge of #69213 - LeSeulArtichaut:improve-doc-iter, r=steveklabnik
[rust.git] / src / test / rustdoc / where.rs
1 #![crate_name = "foo"]
2
3 pub trait MyTrait { fn dummy(&self) { } }
4
5 // @has foo/struct.Alpha.html '//pre' "pub struct Alpha<A>(_) where A: MyTrait"
6 pub struct Alpha<A>(A) where A: MyTrait;
7 // @has foo/trait.Bravo.html '//pre' "pub trait Bravo<B> where B: MyTrait"
8 pub trait Bravo<B> where B: MyTrait { fn get(&self, B: B); }
9 // @has foo/fn.charlie.html '//pre' "pub fn charlie<C>() where C: MyTrait"
10 pub fn charlie<C>() where C: MyTrait {}
11
12 pub struct Delta<D>(D);
13
14 // @has foo/struct.Delta.html '//*[@class="impl"]//code' \
15 //          "impl<D> Delta<D> where D: MyTrait"
16 impl<D> Delta<D> where D: MyTrait {
17     pub fn delta() {}
18 }
19
20 pub struct Echo<E>(E);
21
22 // @has foo/struct.Echo.html '//*[@class="impl"]//code' \
23 //          "impl<E> MyTrait for Echo<E> where E: MyTrait"
24 // @has foo/trait.MyTrait.html '//*[@id="implementors-list"]//code' \
25 //          "impl<E> MyTrait for Echo<E> where E: MyTrait"
26 impl<E> MyTrait for Echo<E> where E: MyTrait {}
27
28 pub enum Foxtrot<F> { Foxtrot1(F) }
29
30 // @has foo/enum.Foxtrot.html '//*[@class="impl"]//code' \
31 //          "impl<F> MyTrait for Foxtrot<F> where F: MyTrait"
32 // @has foo/trait.MyTrait.html '//*[@id="implementors-list"]//code' \
33 //          "impl<F> MyTrait for Foxtrot<F> where F: MyTrait"
34 impl<F> MyTrait for Foxtrot<F> where F: MyTrait {}
35
36 // @has foo/type.Golf.html '//pre[@class="rust typedef"]' \
37 //          "type Golf<T> where T: Clone, = (T, T)"
38 pub type Golf<T> where T: Clone = (T, T);