]> git.proxmox.com Git - rustc.git/blame - src/test/rustdoc/issue-28478.rs
New upstream version 1.67.1+dfsg1
[rustc.git] / src / test / rustdoc / issue-28478.rs
CommitLineData
54a0048b 1#![feature(associated_type_defaults)]
54a0048b
SL
2
3// @has issue_28478/trait.Bar.html
4pub trait Bar {
5 // @has - '//*[@id="associatedtype.Bar"]' 'type Bar = ()'
6 // @has - '//*[@href="#associatedtype.Bar"]' 'Bar'
7 type Bar = ();
8bb4bdeb 8 // @has - '//*[@id="associatedconstant.Baz"]' 'const Baz: usize'
54a0048b
SL
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
18pub struct Foo;
19
20impl Foo {
21 // @has - '//*[@href="#method.foo"]' 'foo'
22 pub fn foo() {}
23}
24
25impl Bar for Foo {
cdc7bbd5
XL
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'
54a0048b 29 fn bar() {}
cdc7bbd5 30 // @has - '//*[@href="trait.Bar.html#method.baz"]' 'baz'
54a0048b 31}