Don't lint about missing code examples in derived traits

Fixes #81775
This commit is contained in:
Hans 2021-09-08 01:09:15 +02:00 committed by Hans Niklas Jacob
parent e4828d5b7f
commit 5f464bb7f2
2 changed files with 10 additions and 0 deletions

View file

@ -96,6 +96,7 @@ crate fn should_have_doc_example(cx: &DocContext<'_>, item: &clean::Item) -> boo
if cx.tcx.hir().attrs(hir_id).lists(sym::doc).has_word(sym::hidden)
|| inherits_doc_hidden(cx.tcx, hir_id)
|| cx.tcx.hir().span(hir_id).in_derive_expansion()
{
return false;
}

View file

@ -78,6 +78,15 @@ impl Clone for Struct {
}
/// doc
///
/// ```
/// println!("hello");
/// ```
#[derive(Clone)]
pub struct NiceStruct;
#[doc(hidden)]
pub mod foo {
pub fn bar() {}