Skip to content

Commit 92d4164

Browse files
committed
better code
1 parent 636d872 commit 92d4164

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

compiler/rustc_middle/src/middle/stability.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -233,12 +233,12 @@ fn late_report_deprecation(
233233
if span.in_derive_expansion() {
234234
return;
235235
}
236-
237-
tcx.struct_span_lint_hir(lint, hir_id, method_span.unwrap_or(span), |lint| {
236+
let method_span = method_span.unwrap_or(span);
237+
tcx.struct_span_lint_hir(lint, hir_id, method_span, |lint| {
238238
let mut diag = lint.build(message);
239239
if let hir::Node::Expr(_) = tcx.hir().get(hir_id) {
240240
let kind = tcx.def_kind(def_id).descr(def_id);
241-
deprecation_suggestion(&mut diag, kind, suggestion, method_span.unwrap_or(span));
241+
deprecation_suggestion(&mut diag, kind, suggestion, method_span);
242242
}
243243
diag.emit()
244244
});

0 commit comments

Comments
 (0)