Skip to content

Commit

Permalink
Update missing code example test
Browse files Browse the repository at this point in the history
  • Loading branch information
GuillaumeGomez committed Mar 4, 2021
1 parent 4b30625 commit 91095b1
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 5 deletions.
21 changes: 17 additions & 4 deletions src/test/rustdoc-ui/lint-missing-doc-code-example.rs
Expand Up @@ -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() {}
Expand Down Expand Up @@ -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() {}
}
2 changes: 1 addition & 1 deletion src/test/rustdoc-ui/lint-missing-doc-code-example.stderr
@@ -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 | | }
| |_^
|
Expand Down

0 comments on commit 91095b1

Please sign in to comment.