3 pub trait MyTrait { fn dummy(&self) { } }
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 {}
12 pub struct Delta<D>(D);
14 // @has foo/struct.Delta.html '//*[@class="impl has-srclink"]//h3[@class="code-header in-band"]' \
15 // "impl<D> Delta<D>where D: MyTrait"
16 impl<D> Delta<D> where D: MyTrait {
20 pub struct Echo<E>(E);
22 // @has 'foo/struct.Simd.html'
23 // @snapshot SWhere_Simd_item-decl - '//div[@class="docblock item-decl"]'
24 pub struct Simd<T>([T; 1])
28 // @has 'foo/trait.TraitWhere.html'
29 // @snapshot SWhere_TraitWhere_item-decl - '//div[@class="docblock item-decl"]'
30 pub trait TraitWhere {
31 type Item<'a> where Self: 'a;
34 // @has foo/struct.Echo.html '//*[@class="impl has-srclink"]//h3[@class="code-header in-band"]' \
35 // "impl<E> MyTrait for Echo<E>where E: MyTrait"
36 // @has foo/trait.MyTrait.html '//*[@id="implementors-list"]//h3[@class="code-header in-band"]' \
37 // "impl<E> MyTrait for Echo<E>where E: MyTrait"
38 impl<E> MyTrait for Echo<E>where E: MyTrait {}
40 pub enum Foxtrot<F> { Foxtrot1(F) }
42 // @has foo/enum.Foxtrot.html '//*[@class="impl has-srclink"]//h3[@class="code-header in-band"]' \
43 // "impl<F> MyTrait for Foxtrot<F>where F: MyTrait"
44 // @has foo/trait.MyTrait.html '//*[@id="implementors-list"]//h3[@class="code-header in-band"]' \
45 // "impl<F> MyTrait for Foxtrot<F>where F: MyTrait"
46 impl<F> MyTrait for Foxtrot<F>where F: MyTrait {}
48 // @has foo/type.Golf.html '//pre[@class="rust typedef"]' \
49 // "type Golf<T>where T: Clone, = (T, T)"
50 pub type Golf<T> where T: Clone = (T, T);