]> git.lizzy.rs Git - rust.git/blob - src/test/run-make/rustdoc-where/foo.rs
rustdoc: Clean up some htmldocck tests
[rust.git] / src / test / run-make / rustdoc-where / foo.rs
1 // Copyright 2014 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 pub trait MyTrait {}
12
13 // @has foo/struct.Alpha.html '//pre' "pub struct Alpha<A> where A: MyTrait"
14 pub struct Alpha<A> where A: MyTrait;
15 // @has foo/trait.Bravo.html '//pre' "pub trait Bravo<B> where B: MyTrait"
16 pub trait Bravo<B> where B: MyTrait {}
17 // @has foo/fn.charlie.html '//pre' "pub fn charlie<C>() where C: MyTrait"
18 pub fn charlie<C>() where C: MyTrait {}
19
20 pub struct Delta<D>;
21 // @has foo/struct.Delta.html '//*[@class="impl"]//code' \
22 //          "impl<D> Delta<D> where D: MyTrait"
23 impl<D> Delta<D> where D: MyTrait {
24     pub fn delta() {}
25 }
26
27 pub struct Echo<E>;
28 // @has foo/struct.Echo.html '//*[@class="impl"]//code' \
29 //          "impl<E> MyTrait for Echo<E> where E: MyTrait"
30 // @has foo/trait.MyTrait.html '//*[@id="implementors-list"]//code' \
31 //          "impl<E> MyTrait for Echo<E> where E: MyTrait"
32 impl<E> MyTrait for Echo<E> where E: MyTrait {}
33
34 pub enum Foxtrot<F> {}
35 // @has foo/enum.Foxtrot.html '//*[@class="impl"]//code' \
36 //          "impl<F> MyTrait for Foxtrot<F> where F: MyTrait"
37 // @has foo/trait.MyTrait.html '//*[@id="implementors-list"]//code' \
38 //          "impl<F> MyTrait for Foxtrot<F> where F: MyTrait"
39 impl<F> MyTrait for Foxtrot<F> where F: MyTrait {}