diff options
| author | Yuki Okushi <huyuumi.dev@gmail.com> | 2020-08-19 15:54:37 +0900 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-08-19 15:54:37 +0900 |
| commit | 98f7d882c8ebd4e505fc407ed261b48c2f54c697 (patch) | |
| tree | 88518cfc0b3243290a63db734a35593df824fd26 /src/test/rustdoc-ui/coverage/doc-examples.rs | |
| parent | e6fe5232df75246921f8b89d0161e4508f1cc535 (diff) | |
| parent | f957bae74eb4e8847b0c0af5cd2c01812b110fc0 (diff) | |
| download | rust-98f7d882c8ebd4e505fc407ed261b48c2f54c697.tar.gz rust-98f7d882c8ebd4e505fc407ed261b48c2f54c697.zip | |
Rollup merge of #75665 - GuillaumeGomez:doc-examples-coverage, r=jyn514
Add doc examples coverage r? @jyn514
Diffstat (limited to 'src/test/rustdoc-ui/coverage/doc-examples.rs')
| -rw-r--r-- | src/test/rustdoc-ui/coverage/doc-examples.rs | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/src/test/rustdoc-ui/coverage/doc-examples.rs b/src/test/rustdoc-ui/coverage/doc-examples.rs new file mode 100644 index 00000000000..cd718f8a34d --- /dev/null +++ b/src/test/rustdoc-ui/coverage/doc-examples.rs @@ -0,0 +1,27 @@ +// compile-flags:-Z unstable-options --show-coverage +// check-pass + +//! This test ensure that only rust code examples are counted. + +/// Doc +/// +/// ``` +/// let x = 2; +/// ``` +pub struct Foo; + +/// Doc +/// +/// ```text +/// yolo +/// ``` +pub trait Bar {} + +/// Doc +/// +/// ```ignore (just for the sake of this test) +/// let x = 2; +/// ``` +pub fn foo<T: Bar, D: ::std::fmt::Debug>(a: Foo, b: u32, c: T, d: D) -> u32 { + 0 +} |
