]> git.lizzy.rs Git - rust.git/blob - tests/rustdoc/issue-28478.rs
Rollup merge of #106244 - atouchet:readme3, r=workingjubilee
[rust.git] / tests / rustdoc / issue-28478.rs
1 #![feature(associated_type_defaults)]
2
3 // @has issue_28478/trait.Bar.html
4 pub trait Bar {
5     // @has - '//*[@id="associatedtype.Bar"]' 'type Bar = ()'
6     // @has - '//*[@href="#associatedtype.Bar"]' 'Bar'
7     type Bar = ();
8     // @has - '//*[@id="associatedconstant.Baz"]' 'const Baz: usize'
9     // @has - '//*[@href="#associatedconstant.Baz"]' 'Baz'
10     const Baz: usize = 7;
11     // @has - '//*[@id="tymethod.bar"]' 'fn bar'
12     fn bar();
13     // @has - '//*[@id="method.baz"]' 'fn baz'
14     fn baz() { }
15 }
16
17 // @has issue_28478/struct.Foo.html
18 pub struct Foo;
19
20 impl Foo {
21     // @has - '//*[@href="#method.foo"]' 'foo'
22     pub fn foo() {}
23 }
24
25 impl Bar for Foo {
26     // @has - '//*[@href="trait.Bar.html#associatedtype.Bar"]' 'Bar'
27     // @has - '//*[@href="trait.Bar.html#associatedconstant.Baz"]' 'Baz'
28     // @has - '//*[@href="trait.Bar.html#tymethod.bar"]' 'bar'
29     fn bar() {}
30     // @has - '//*[@href="trait.Bar.html#method.baz"]' 'baz'
31 }