Skip to content
This repository was archived by the owner on Aug 16, 2021. It is now read-only.

Commit 8058642

Browse files
committed
Remove #[allow(missing_docs)] in generated code.
1 parent 3fd18db commit 8058642

File tree

4 files changed

+27
-2
lines changed

4 files changed

+27
-2
lines changed

.travis.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ before_script:
2121
script:
2222
- cargo build --verbose $FEATURES
2323
- cargo test --verbose $FEATURES
24+
- cd test-doc && cargo build
2425

2526
after_success:
2627
- travis-cargo --only stable doc

src/error_chain.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -166,9 +166,9 @@ macro_rules! error_chain_processed {
166166
quick_error! {
167167
/// The kind of an error
168168
#[derive(Debug)]
169-
#[allow(missing_docs)]
170169
pub enum $error_kind_name {
171170

171+
/// A convenient variant for String.
172172
Msg(s: String) {
173173
description(&s)
174174
display("{}", s)

test-doc/src/lib.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,13 @@ pub mod doc {
1212

1313
error_chain! {
1414
links {
15-
inner::Error, Test;
15+
inner::Error, Test, #[doc = "Doc"];
16+
}
17+
foreign_links {
18+
::std::io::Error, Io, #[doc = "Io"];
1619
}
1720
errors {
21+
/// Doc
1822
Test2 {
1923

2024
}

tests/tests.rs

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -407,3 +407,23 @@ fn without_result() {
407407
}
408408
let _: Result<(), ()> = Ok(());
409409
}
410+
411+
#[test]
412+
fn documentation() {
413+
mod inner {
414+
error_chain! {}
415+
}
416+
417+
error_chain! {
418+
links {
419+
inner::Error, Inner, #[doc = "Doc"];
420+
}
421+
foreign_links {
422+
::std::io::Error, Io, #[doc = "Doc"];
423+
}
424+
errors {
425+
/// Doc
426+
Variant
427+
}
428+
}
429+
}

0 commit comments

Comments
 (0)