Disable `[
new-without-default]
` for new() methods that are marked with '#[doc(hidden)]'
Fixes issue #8152
This commit is contained in:
parent
7b2896a8fc
commit
862211d540
@ -85,6 +85,10 @@ fn check_item(&mut self, cx: &LateContext<'tcx>, item: &'tcx hir::Item<'_>) {
|
||||
// can't be implemented for unsafe new
|
||||
return;
|
||||
}
|
||||
if clippy_utils::is_doc_hidden(cx.tcx.hir().attrs(id)) {
|
||||
// shouldn't be implemented when it is hidden in docs
|
||||
return;
|
||||
}
|
||||
if impl_item
|
||||
.generics
|
||||
.params
|
||||
|
@ -201,4 +201,14 @@ pub fn new() -> Self {
|
||||
}
|
||||
}
|
||||
|
||||
// see issue #8152
|
||||
// This should not create any lints
|
||||
pub struct DocHidden;
|
||||
impl DocHidden {
|
||||
#[doc(hidden)]
|
||||
pub fn new() -> Self {
|
||||
DocHidden
|
||||
}
|
||||
}
|
||||
|
||||
fn main() {}
|
||||
|
Loading…
Reference in New Issue
Block a user