rust/tests/rustdoc-ui/doc-without-codeblock.rs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

24 lines
662 B
Rust
Raw Normal View History

#![feature(rustdoc_missing_doc_code_examples)] //~ ERROR missing code example in this documentation
#![deny(rustdoc::missing_doc_code_examples)]
2018-10-09 22:46:29 +08:00
/// Some docs.
2019-11-25 10:42:22 +08:00
//~^ ERROR missing code example in this documentation
2018-10-09 22:46:29 +08:00
pub struct Foo;
/// And then, the princess died.
2019-11-25 10:42:22 +08:00
//~^ ERROR missing code example in this documentation
2018-10-09 22:46:29 +08:00
pub mod foo {
/// Or maybe not because she saved herself!
2019-11-25 10:42:22 +08:00
//~^ ERROR missing code example in this documentation
2018-10-09 22:46:29 +08:00
pub fn bar() {}
}
// This impl is here to ensure the lint isn't emitted for foreign traits implementations.
impl std::ops::Neg for Foo {
type Output = Self;
fn neg(self) -> Self::Output {
Self
}
}