]> git.lizzy.rs Git - rust.git/blob - src/test/rustdoc/issue-28478.rs
Rollup merge of #43100 - ids1024:stat2, r=aturon
[rust.git] / src / test / rustdoc / issue-28478.rs
1 // Copyright 2016 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 #![feature(associated_type_defaults)]
12
13 // @has issue_28478/trait.Bar.html
14 pub trait Bar {
15     // @has - '//*[@id="associatedtype.Bar"]' 'type Bar = ()'
16     // @has - '//*[@href="#associatedtype.Bar"]' 'Bar'
17     type Bar = ();
18     // @has - '//*[@id="associatedconstant.Baz"]' 'const Baz: usize'
19     // @has - '//*[@class="docblock"]' 'Baz: usize = 7'
20     // @has - '//*[@href="#associatedconstant.Baz"]' 'Baz'
21     const Baz: usize = 7;
22     // @has - '//*[@id="tymethod.bar"]' 'fn bar'
23     fn bar();
24     // @has - '//*[@id="method.baz"]' 'fn baz'
25     fn baz() { }
26 }
27
28 // @has issue_28478/struct.Foo.html
29 pub struct Foo;
30
31 impl Foo {
32     // @has - '//*[@href="#method.foo"]' 'foo'
33     pub fn foo() {}
34 }
35
36 impl Bar for Foo {
37     // @has - '//*[@href="../issue_28478/trait.Bar.html#associatedtype.Bar"]' 'Bar'
38     // @has - '//*[@href="../issue_28478/trait.Bar.html#associatedconstant.Baz"]' 'Baz'
39     // @has - '//*[@href="../issue_28478/trait.Bar.html#tymethod.bar"]' 'bar'
40     fn bar() {}
41     // @has - '//*[@href="../issue_28478/trait.Bar.html#method.baz"]' 'baz'
42 }