diff options
| author | Tyler Mandry <tmandry@gmail.com> | 2020-09-16 12:24:23 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-09-16 12:24:23 -0700 |
| commit | 6e0131cd5b8867e7c7363ed85ef4ce6a10dc511f (patch) | |
| tree | 074ba1d18518caf7284ee85ebb63df8f6905ecbc | |
| parent | 273267c9ee16e72133d6548aac20997153cbdd81 (diff) | |
| parent | fd9be8f7aadb729e6c37c71419b43fc4d3c188f9 (diff) | |
| download | rust-6e0131cd5b8867e7c7363ed85ef4ce6a10dc511f.tar.gz rust-6e0131cd5b8867e7c7363ed85ef4ce6a10dc511f.zip | |
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)
| -rw-r--r-- | compiler/rustc_lint/src/builtin.rs | 2 | ||||
| -rw-r--r-- | compiler/rustc_metadata/src/native_libs.rs | 4 |
2 files changed, 3 insertions, 3 deletions
diff --git a/compiler/rustc_lint/src/builtin.rs b/compiler/rustc_lint/src/builtin.rs index efdb7489ba5..5b5dbcf192c 100644 --- a/compiler/rustc_lint/src/builtin.rs +++ b/compiler/rustc_lint/src/builtin.rs @@ -961,7 +961,7 @@ fn warn_if_doc(cx: &EarlyContext<'_>, node_span: Span, node_kind: &str, attrs: & continue; } - let span = sugared_span.take().unwrap_or_else(|| attr.span); + let span = sugared_span.take().unwrap_or(attr.span); if attr.is_doc_comment() || cx.sess().check_name(attr, sym::doc) { cx.struct_span_lint(UNUSED_DOC_COMMENTS, span, |lint| { diff --git a/compiler/rustc_metadata/src/native_libs.rs b/compiler/rustc_metadata/src/native_libs.rs index 3976475cb06..e76c2cb356f 100644 --- a/compiler/rustc_metadata/src/native_libs.rs +++ b/compiler/rustc_metadata/src/native_libs.rs @@ -170,7 +170,7 @@ impl Collector<'tcx> { feature_err( &self.tcx.sess.parse_sess, sym::static_nobundle, - span.unwrap_or_else(|| rustc_span::DUMMY_SP), + span.unwrap_or(rustc_span::DUMMY_SP), "kind=\"static-nobundle\" is unstable", ) .emit(); @@ -179,7 +179,7 @@ impl Collector<'tcx> { feature_err( &self.tcx.sess.parse_sess, sym::raw_dylib, - span.unwrap_or_else(|| rustc_span::DUMMY_SP), + span.unwrap_or(rustc_span::DUMMY_SP), "kind=\"raw-dylib\" is unstable", ) .emit(); |
