Skip to content

Commit 6e0131c

Browse files
authored
Rollup merge of #76760 - matthiaskrgr:clippy_lazy_eval, r=varkor
don't lazily evaluate some trivial values for Option::None replacements (clippy::unnecessary_lazy_evaluations)
2 parents 273267c + fd9be8f commit 6e0131c

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

compiler/rustc_lint/src/builtin.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -961,7 +961,7 @@ fn warn_if_doc(cx: &EarlyContext<'_>, node_span: Span, node_kind: &str, attrs: &
961961
continue;
962962
}
963963

964-
let span = sugared_span.take().unwrap_or_else(|| attr.span);
964+
let span = sugared_span.take().unwrap_or(attr.span);
965965

966966
if attr.is_doc_comment() || cx.sess().check_name(attr, sym::doc) {
967967
cx.struct_span_lint(UNUSED_DOC_COMMENTS, span, |lint| {

compiler/rustc_metadata/src/native_libs.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,7 @@ impl Collector<'tcx> {
170170
feature_err(
171171
&self.tcx.sess.parse_sess,
172172
sym::static_nobundle,
173-
span.unwrap_or_else(|| rustc_span::DUMMY_SP),
173+
span.unwrap_or(rustc_span::DUMMY_SP),
174174
"kind=\"static-nobundle\" is unstable",
175175
)
176176
.emit();
@@ -179,7 +179,7 @@ impl Collector<'tcx> {
179179
feature_err(
180180
&self.tcx.sess.parse_sess,
181181
sym::raw_dylib,
182-
span.unwrap_or_else(|| rustc_span::DUMMY_SP),
182+
span.unwrap_or(rustc_span::DUMMY_SP),
183183
"kind=\"raw-dylib\" is unstable",
184184
)
185185
.emit();

0 commit comments

Comments
 (0)