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 09:46:29 -05:00
/// Some docs.
2019-11-24 20:42:22 -06:00
//~^ ERROR missing code example in this documentation
2018-10-09 09:46:29 -05:00
pub struct Foo;
/// And then, the princess died.
2019-11-24 20:42:22 -06:00
//~^ ERROR missing code example in this documentation
2018-10-09 09:46:29 -05:00
pub mod foo {
/// Or maybe not because she saved herself!
2019-11-24 20:42:22 -06:00
//~^ ERROR missing code example in this documentation
2018-10-09 09:46:29 -05: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
}
}