1
Fork 0

Update rustdoc-ui tests

This commit is contained in:
Guillaume Gomez 2019-05-17 13:39:20 +02:00
parent b5d4bd2a07
commit c78af2bc60
4 changed files with 38 additions and 8 deletions

View file

@ -1,6 +1,4 @@
//~ ERROR Missing code example in this documentation #![deny(missing_doc_code_examples)] //~ ERROR Missing code example in this documentation
#![deny(missing_doc_code_examples)]
/// Some docs. /// Some docs.
//~^ ERROR Missing code example in this documentation //~^ ERROR Missing code example in this documentation

View file

@ -1,25 +1,35 @@
error: Missing code example in this documentation error: Missing code example in this documentation
--> $DIR/doc-without-codeblock.rs:1:1
|
LL | / #![deny(missing_doc_code_examples)]
LL | |
LL | | /// Some docs.
LL | |
... |
LL | | pub fn bar() {}
LL | | }
| |_^
| |
note: lint level defined here note: lint level defined here
--> $DIR/doc-without-codeblock.rs:3:9 --> $DIR/doc-without-codeblock.rs:1:9
| |
LL | #![deny(missing_doc_code_examples)] LL | #![deny(missing_doc_code_examples)]
| ^^^^^^^^^^^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^^^^^^^^^^^
error: Missing code example in this documentation error: Missing code example in this documentation
--> $DIR/doc-without-codeblock.rs:5:1 --> $DIR/doc-without-codeblock.rs:3:1
| |
LL | /// Some docs. LL | /// Some docs.
| ^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^
error: Missing code example in this documentation error: Missing code example in this documentation
--> $DIR/doc-without-codeblock.rs:9:1 --> $DIR/doc-without-codeblock.rs:7:1
| |
LL | /// And then, the princess died. LL | /// And then, the princess died.
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error: Missing code example in this documentation error: Missing code example in this documentation
--> $DIR/doc-without-codeblock.rs:12:5 --> $DIR/doc-without-codeblock.rs:10:5
| |
LL | /// Or maybe not because she saved herself! LL | /// Or maybe not because she saved herself!
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

View file

@ -16,7 +16,7 @@ fn test() {
} }
#[allow(missing_docs)] #[allow(missing_docs)]
mod module1 { mod module1 { //~ ERROR
} }
#[allow(missing_doc_code_examples)] #[allow(missing_doc_code_examples)]
@ -35,5 +35,6 @@ mod module2 {
pub mod module3 { pub mod module3 {
/// doc /// doc
//~^ ERROR
pub fn test() {} pub fn test() {}
} }

View file

@ -0,0 +1,21 @@
error: Missing code example in this documentation
--> $DIR/lint-missing-doc-code-example.rs:19:1
|
LL | / mod module1 {
LL | | }
| |_^
|
note: lint level defined here
--> $DIR/lint-missing-doc-code-example.rs:2:9
|
LL | #![deny(missing_doc_code_examples)]
| ^^^^^^^^^^^^^^^^^^^^^^^^^
error: Missing code example in this documentation
--> $DIR/lint-missing-doc-code-example.rs:37:3
|
LL | /// doc
| ^^^^^^^
error: aborting due to 2 previous errors