We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 9ec13a6 commit 64f1f52Copy full SHA for 64f1f52
compiler/rustc_lint/src/unused.rs
@@ -938,12 +938,8 @@ trait UnusedDelimLint {
938
Closure(ref closure)
939
if matches!(closure.fn_decl.output, FnRetTy::Default(_))
940
// skip `#[core::contracts::requires(...)]` and `#[core::contracts::ensures(...)]` which generate closure
941
- && !cx
942
- .sess()
943
- .source_map()
944
- .span_to_snippet(closure.fn_decl_span)
945
- .unwrap_or_default()
946
- .contains("core::contracts") =>
+ // with span that is same as the closure body span
+ && e.span != closure.body.span =>
947
{
948
(&[closure.body.clone()][..], UnusedDelimsCtx::ClosureBody)
949
}
0 commit comments