better code
This commit is contained in:
parent
636d872452
commit
92d4164aca
1 changed files with 3 additions and 3 deletions
|
|
@ -233,12 +233,12 @@ fn late_report_deprecation(
|
|||
if span.in_derive_expansion() {
|
||||
return;
|
||||
}
|
||||
|
||||
tcx.struct_span_lint_hir(lint, hir_id, method_span.unwrap_or(span), |lint| {
|
||||
let method_span = method_span.unwrap_or(span);
|
||||
tcx.struct_span_lint_hir(lint, hir_id, method_span, |lint| {
|
||||
let mut diag = lint.build(message);
|
||||
if let hir::Node::Expr(_) = tcx.hir().get(hir_id) {
|
||||
let kind = tcx.def_kind(def_id).descr(def_id);
|
||||
deprecation_suggestion(&mut diag, kind, suggestion, method_span.unwrap_or(span));
|
||||
deprecation_suggestion(&mut diag, kind, suggestion, method_span);
|
||||
}
|
||||
diag.emit()
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue