2015-04-06 13:49:30 -07:00
|
|
|
#![crate_name = "foo"]
|
|
|
|
|
2015-02-12 10:29:52 -05:00
|
|
|
pub trait MyTrait { fn dummy(&self) { } }
|
2014-09-25 02:01:42 -07:00
|
|
|
|
2016-07-25 18:19:11 +01:00
|
|
|
// @has foo/struct.Alpha.html '//pre' "pub struct Alpha<A>(_) where A: MyTrait"
|
2015-02-12 10:29:52 -05:00
|
|
|
pub struct Alpha<A>(A) where A: MyTrait;
|
2015-02-05 23:54:11 -08:00
|
|
|
// @has foo/trait.Bravo.html '//pre' "pub trait Bravo<B> where B: MyTrait"
|
2015-02-12 10:29:52 -05:00
|
|
|
pub trait Bravo<B> where B: MyTrait { fn get(&self, B: B); }
|
2015-02-05 23:54:11 -08:00
|
|
|
// @has foo/fn.charlie.html '//pre' "pub fn charlie<C>() where C: MyTrait"
|
2014-09-25 02:01:42 -07:00
|
|
|
pub fn charlie<C>() where C: MyTrait {}
|
|
|
|
|
2015-02-12 10:29:52 -05:00
|
|
|
pub struct Delta<D>(D);
|
|
|
|
|
2021-07-25 21:41:57 +00:00
|
|
|
// @has foo/struct.Delta.html '//*[@class="impl has-srclink"]//h3[@class="code-header in-band"]' \
|
2015-02-05 23:54:11 -08:00
|
|
|
// "impl<D> Delta<D> where D: MyTrait"
|
2014-09-25 02:01:42 -07:00
|
|
|
impl<D> Delta<D> where D: MyTrait {
|
|
|
|
pub fn delta() {}
|
|
|
|
}
|
|
|
|
|
2015-02-12 10:29:52 -05:00
|
|
|
pub struct Echo<E>(E);
|
|
|
|
|
2021-07-25 21:41:57 +00:00
|
|
|
// @has foo/struct.Echo.html '//*[@class="impl has-srclink"]//h3[@class="code-header in-band"]' \
|
2015-02-05 23:54:11 -08:00
|
|
|
// "impl<E> MyTrait for Echo<E> where E: MyTrait"
|
2021-07-25 21:41:57 +00:00
|
|
|
// @has foo/trait.MyTrait.html '//*[@id="implementors-list"]//h3[@class="code-header in-band"]' \
|
2015-02-05 23:54:11 -08:00
|
|
|
// "impl<E> MyTrait for Echo<E> where E: MyTrait"
|
2014-09-25 02:01:42 -07:00
|
|
|
impl<E> MyTrait for Echo<E> where E: MyTrait {}
|
|
|
|
|
2015-02-12 10:29:52 -05:00
|
|
|
pub enum Foxtrot<F> { Foxtrot1(F) }
|
|
|
|
|
2021-07-25 21:41:57 +00:00
|
|
|
// @has foo/enum.Foxtrot.html '//*[@class="impl has-srclink"]//h3[@class="code-header in-band"]' \
|
2015-02-05 23:54:11 -08:00
|
|
|
// "impl<F> MyTrait for Foxtrot<F> where F: MyTrait"
|
2021-07-25 21:41:57 +00:00
|
|
|
// @has foo/trait.MyTrait.html '//*[@id="implementors-list"]//h3[@class="code-header in-band"]' \
|
2015-02-05 23:54:11 -08:00
|
|
|
// "impl<F> MyTrait for Foxtrot<F> where F: MyTrait"
|
2014-09-25 02:01:42 -07:00
|
|
|
impl<F> MyTrait for Foxtrot<F> where F: MyTrait {}
|
2015-05-25 23:05:35 +02:00
|
|
|
|
|
|
|
// @has foo/type.Golf.html '//pre[@class="rust typedef"]' \
|
2017-04-06 14:19:45 -05:00
|
|
|
// "type Golf<T> where T: Clone, = (T, T)"
|
2015-05-25 23:05:35 +02:00
|
|
|
pub type Golf<T> where T: Clone = (T, T);
|