about summary refs log tree commit diff
path: root/src/test/rustdoc/trait-attributes.rs
blob: a6ee046edec8b03d173b223ceb38ff9f94e41877 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#![crate_name = "foo"]

// ignore-tidy-linelength

pub trait Foo {
    // @has foo/trait.Foo.html '//h3[@id="tymethod.foo"]//span[@class="docblock attributes"]' '#[must_use]'
    #[must_use]
    fn foo();
}

#[must_use]
pub struct Bar;

impl Bar {
    // @has foo/struct.Bar.html '//h4[@id="method.bar"]//span[@class="docblock attributes"]' '#[must_use]'
    #[must_use]
    pub fn bar() {}

    // @has foo/struct.Bar.html '//h4[@id="method.bar2"]//span[@class="docblock attributes"]' '#[must_use]'
    #[must_use]
    pub fn bar2() {}
}