1
Fork 0

Update attribute tests

This commit is contained in:
Manish Goregaokar 2021-04-12 23:03:17 -07:00
parent 5c2820b913
commit 55b29443db
2 changed files with 8 additions and 8 deletions

View file

@ -1,21 +1,21 @@
#![crate_name = "foo"]
// @has foo/fn.f.html '//*[@class="docblock attributes"]' '#[no_mangle]'
// @has foo/fn.f.html '//*[@class="rust fn"]' '#[no_mangle]'
#[no_mangle]
pub extern "C" fn f() {}
// @has foo/fn.g.html '//*[@class="docblock attributes"]' '#[export_name = "bar"]'
// @has foo/fn.g.html '//*[@class="rust fn"]' '#[export_name = "bar"]'
#[export_name = "bar"]
pub extern "C" fn g() {}
// @matches foo/enum.Foo.html '//*[@class="docblock attributes top-attr"]' \
// '(?m)\A#\[repr\(i64\)\]\n#\[must_use\]\Z'
// @matches foo/enum.Foo.html '//*[@class="rust enum"]' \
// '#\[repr\(i64\)\]\n#\[must_use\]'
#[repr(i64)]
#[must_use]
pub enum Foo {
Bar,
}
// @has foo/struct.Repr.html '//*[@class="docblock attributes top-attr"]' '#[repr(C, align(8))]'
// @has foo/struct.Repr.html '//*[@class="docblock type-decl"]' '#[repr(C, align(8))]'
#[repr(C, align(8))]
pub struct Repr;

View file

@ -2,7 +2,7 @@
pub trait Foo {
// @has foo/trait.Foo.html '//h3[@id="tymethod.foo"]//span[@class="docblock attributes"]' '#[must_use]'
// @has foo/trait.Foo.html '//h3[@id="tymethod.foo"]//div[@class="code-attribute"]' '#[must_use]'
#[must_use]
fn foo();
}
@ -11,11 +11,11 @@ pub trait Foo {
pub struct Bar;
impl Bar {
// @has foo/struct.Bar.html '//h4[@id="method.bar"]//span[@class="docblock attributes"]' '#[must_use]'
// @has foo/struct.Bar.html '//h4[@id="method.bar"]//div[@class="code-attribute"]' '#[must_use]'
#[must_use]
pub fn bar() {}
// @has foo/struct.Bar.html '//h4[@id="method.bar2"]//span[@class="docblock attributes"]' '#[must_use]'
// @has foo/struct.Bar.html '//h4[@id="method.bar2"]//div[@class="code-attribute"]' '#[must_use]'
#[must_use]
pub fn bar2() {}
}