rust/tests/ui/attributes/doc-attr.rs

26 lines
497 B
Rust
Raw Normal View History

2021-03-01 10:13:06 -06:00
#![crate_type = "lib"]
#![deny(warnings)]
#![doc(as_ptr)]
//~^ ERROR unknown `doc` attribute
//~^^ WARN
2021-03-01 10:13:06 -06:00
#[doc(as_ptr)]
//~^ ERROR unknown `doc` attribute
//~^^ WARN
2021-03-01 10:13:06 -06:00
pub fn foo() {}
#[doc(123)]
//~^ ERROR invalid `doc` attribute
//~| WARN
#[doc("hello", "bar")]
//~^ ERROR invalid `doc` attribute
//~| WARN
//~| ERROR invalid `doc` attribute
//~| WARN
#[doc(foo::bar, crate::bar::baz = "bye")]
//~^ ERROR unknown `doc` attribute
//~| WARN
//~| ERROR unknown `doc` attribute
//~| WARN
fn bar() {}