We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
[
]
1 parent 7b2896a commit 862211dCopy full SHA for 862211d
clippy_lints/src/new_without_default.rs
@@ -85,6 +85,10 @@ impl<'tcx> LateLintPass<'tcx> for NewWithoutDefault {
85
// can't be implemented for unsafe new
86
return;
87
}
88
+ if clippy_utils::is_doc_hidden(cx.tcx.hir().attrs(id)) {
89
+ // shouldn't be implemented when it is hidden in docs
90
+ return;
91
+ }
92
if impl_item
93
.generics
94
.params
tests/ui/new_without_default.rs
@@ -201,4 +201,14 @@ pub mod issue7220 {
201
202
203
204
+// see issue #8152
205
+// This should not create any lints
206
+pub struct DocHidden;
207
+impl DocHidden {
208
+ #[doc(hidden)]
209
+ pub fn new() -> Self {
210
+ DocHidden
211
212
+}
213
+
214
fn main() {}
0 commit comments