We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 0597838 + cd45d5a commit 6405469Copy full SHA for 6405469
clippy_lints/src/unused_unit.rs
@@ -58,6 +58,7 @@ impl EarlyLintPass for UnusedUnit {
58
&& let ctxt = block.span.ctxt()
59
&& stmt.span.ctxt() == ctxt
60
&& expr.span.ctxt() == ctxt
61
+ && expr.attrs.is_empty()
62
{
63
let sp = expr.span;
64
span_lint_and_sugg(
tests/ui/unused_unit.fixed
@@ -94,3 +94,10 @@ mod issue9748 {
94
let _ = for<'a> |_: &'a u32| -> () {};
95
}
96
97
+
98
+mod issue9949 {
99
+ fn main() {
100
+ #[doc = "documentation"]
101
+ ()
102
+ }
103
+}
tests/ui/unused_unit.rs
0 commit comments