diff options
| author | Guillaume Gomez <guillaume1.gomez@gmail.com> | 2020-08-21 18:05:51 +0200 |
|---|---|---|
| committer | Guillaume Gomez <guillaume1.gomez@gmail.com> | 2020-08-21 18:08:19 +0200 |
| commit | 7a05f13aed27c75f592c89435350c4826174316a (patch) | |
| tree | 65a1687bca963437139ad8260cb1c0c695ca7819 /src/test/rustdoc-ui/lint-missing-doc-code-example.rs | |
| parent | dadde88ebacd5e209922928206e0d85a99009203 (diff) | |
| download | rust-7a05f13aed27c75f592c89435350c4826174316a.tar.gz rust-7a05f13aed27c75f592c89435350c4826174316a.zip | |
Strenghten tests for missing_doc_code_examples lint
Diffstat (limited to 'src/test/rustdoc-ui/lint-missing-doc-code-example.rs')
| -rw-r--r-- | src/test/rustdoc-ui/lint-missing-doc-code-example.rs | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/src/test/rustdoc-ui/lint-missing-doc-code-example.rs b/src/test/rustdoc-ui/lint-missing-doc-code-example.rs index ffe0ddcd8c9..ebe7a242211 100644 --- a/src/test/rustdoc-ui/lint-missing-doc-code-example.rs +++ b/src/test/rustdoc-ui/lint-missing-doc-code-example.rs @@ -38,3 +38,34 @@ pub mod module3 { //~^ ERROR pub fn test() {} } + +/// Doc, but no code example and it's fine! +pub const Const: u32 = 0; +/// Doc, but no code example and it's fine! +pub static Static: u32 = 0; +/// Doc, but no code example and it's fine! +pub type Type = u32; + +/// Doc +//~^ ERROR +pub struct Struct { + /// Doc, but no code example and it's fine! + pub field: u32, +} + +/// Doc +//~^ ERROR +pub enum Enum { + /// Doc, but no code example and it's fine! + X, +} + +/// Doc +//~^ ERROR +#[repr(C)] +union Union { + /// Doc, but no code example and it's fine! + a: i32, + /// Doc, but no code example and it's fine! + b: f32, +} |
