]> git.proxmox.com Git - rustc.git/blame - src/test/run-make/rustdoc-where/foo.rs
Imported Upstream version 1.0.0~beta
[rustc.git] / src / test / run-make / rustdoc-where / foo.rs
CommitLineData
1a4d82fc 1// Copyright 2014 The Rust Project Developers. See the COPYRIGHT
223e47cc
LB
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
85aaf69f 11pub trait MyTrait { fn dummy(&self) { } }
223e47cc 12
85aaf69f
SL
13// @has foo/struct.Alpha.html '//pre' "pub struct Alpha<A> where A: MyTrait"
14pub struct Alpha<A>(A) where A: MyTrait;
15// @has foo/trait.Bravo.html '//pre' "pub trait Bravo<B> where B: MyTrait"
16pub trait Bravo<B> where B: MyTrait { fn get(&self, B: B); }
17// @has foo/fn.charlie.html '//pre' "pub fn charlie<C>() where C: MyTrait"
1a4d82fc 18pub fn charlie<C>() where C: MyTrait {}
223e47cc 19
85aaf69f
SL
20pub struct Delta<D>(D);
21
22// @has foo/struct.Delta.html '//*[@class="impl"]//code' \
23// "impl<D> Delta<D> where D: MyTrait"
1a4d82fc
JJ
24impl<D> Delta<D> where D: MyTrait {
25 pub fn delta() {}
26}
223e47cc 27
85aaf69f
SL
28pub struct Echo<E>(E);
29
30// @has foo/struct.Echo.html '//*[@class="impl"]//code' \
31// "impl<E> MyTrait for Echo<E> where E: MyTrait"
32// @has foo/trait.MyTrait.html '//*[@id="implementors-list"]//code' \
33// "impl<E> MyTrait for Echo<E> where E: MyTrait"
1a4d82fc 34impl<E> MyTrait for Echo<E> where E: MyTrait {}
223e47cc 35
85aaf69f
SL
36pub enum Foxtrot<F> { Foxtrot1(F) }
37
38// @has foo/enum.Foxtrot.html '//*[@class="impl"]//code' \
39// "impl<F> MyTrait for Foxtrot<F> where F: MyTrait"
40// @has foo/trait.MyTrait.html '//*[@id="implementors-list"]//code' \
41// "impl<F> MyTrait for Foxtrot<F> where F: MyTrait"
1a4d82fc 42impl<F> MyTrait for Foxtrot<F> where F: MyTrait {}