Update missing code example test
This commit is contained in:
parent
4b30625094
commit
91095b1be5
2 changed files with 18 additions and 5 deletions
|
|
@ -12,16 +12,16 @@
|
|||
/// ```
|
||||
/// println!("hello");
|
||||
/// ```
|
||||
fn test() {
|
||||
pub fn test() {
|
||||
}
|
||||
|
||||
#[allow(missing_docs)]
|
||||
mod module1 { //~ ERROR
|
||||
pub mod module1 { //~ ERROR
|
||||
}
|
||||
|
||||
#[allow(rustdoc::missing_doc_code_examples)]
|
||||
/// doc
|
||||
mod module2 {
|
||||
pub mod module2 {
|
||||
|
||||
/// doc
|
||||
pub fn test() {}
|
||||
|
|
@ -63,9 +63,22 @@ pub enum Enum {
|
|||
/// Doc
|
||||
//~^ ERROR
|
||||
#[repr(C)]
|
||||
union Union {
|
||||
pub union Union {
|
||||
/// Doc, but no code example and it's fine!
|
||||
a: i32,
|
||||
/// Doc, but no code example and it's fine!
|
||||
b: f32,
|
||||
}
|
||||
|
||||
|
||||
#[doc(hidden)]
|
||||
pub mod foo {
|
||||
pub fn bar() {}
|
||||
}
|
||||
|
||||
fn babar() {}
|
||||
|
||||
|
||||
mod fofoo {
|
||||
pub fn tadam() {}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
error: missing code example in this documentation
|
||||
--> $DIR/lint-missing-doc-code-example.rs:19:1
|
||||
|
|
||||
LL | / mod module1 {
|
||||
LL | / pub mod module1 {
|
||||
LL | | }
|
||||
| |_^
|
||||
|
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue