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)
This commit is contained in:
commit
6e0131cd5b
@ -961,7 +961,7 @@ fn warn_if_doc(cx: &EarlyContext<'_>, node_span: Span, node_kind: &str, attrs: &
|
|||||||
continue;
|
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) {
|
if attr.is_doc_comment() || cx.sess().check_name(attr, sym::doc) {
|
||||||
cx.struct_span_lint(UNUSED_DOC_COMMENTS, span, |lint| {
|
cx.struct_span_lint(UNUSED_DOC_COMMENTS, span, |lint| {
|
||||||
|
@ -170,7 +170,7 @@ impl Collector<'tcx> {
|
|||||||
feature_err(
|
feature_err(
|
||||||
&self.tcx.sess.parse_sess,
|
&self.tcx.sess.parse_sess,
|
||||||
sym::static_nobundle,
|
sym::static_nobundle,
|
||||||
span.unwrap_or_else(|| rustc_span::DUMMY_SP),
|
span.unwrap_or(rustc_span::DUMMY_SP),
|
||||||
"kind=\"static-nobundle\" is unstable",
|
"kind=\"static-nobundle\" is unstable",
|
||||||
)
|
)
|
||||||
.emit();
|
.emit();
|
||||||
@ -179,7 +179,7 @@ impl Collector<'tcx> {
|
|||||||
feature_err(
|
feature_err(
|
||||||
&self.tcx.sess.parse_sess,
|
&self.tcx.sess.parse_sess,
|
||||||
sym::raw_dylib,
|
sym::raw_dylib,
|
||||||
span.unwrap_or_else(|| rustc_span::DUMMY_SP),
|
span.unwrap_or(rustc_span::DUMMY_SP),
|
||||||
"kind=\"raw-dylib\" is unstable",
|
"kind=\"raw-dylib\" is unstable",
|
||||||
)
|
)
|
||||||
.emit();
|
.emit();
|
||||||
|
Loading…
Reference in New Issue
Block a user