Skip to content

Commit

Permalink
Rollup merge of rust-lang#76760 - matthiaskrgr:clippy_lazy_eval, r=va…
Browse files Browse the repository at this point in the history
…rkor

don't lazily evaluate some trivial values for Option::None replacements (clippy::unnecessary_lazy_evaluations)
  • Loading branch information
tmandry committed Sep 16, 2020
2 parents 273267c + fd9be8f commit 6e0131c
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion compiler/rustc_lint/src/builtin.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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| {
Expand Down
4 changes: 2 additions & 2 deletions compiler/rustc_metadata/src/native_libs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand All @@ -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();
Expand Down

0 comments on commit 6e0131c

Please sign in to comment.