Remove guess_head_span.
This commit is contained in:
parent
36f4f4aa38
commit
6733bc3066
20 changed files with 93 additions and 103 deletions
|
@ -41,8 +41,8 @@ pub(crate) fn check<'tcx>(tcx: TyCtxt<'tcx>, body: &Body<'tcx>) {
|
|||
|
||||
vis.reachable_recursive_calls.sort();
|
||||
|
||||
let sp = tcx.def_span(def_id);
|
||||
let hir_id = tcx.hir().local_def_id_to_hir_id(def_id);
|
||||
let sp = tcx.sess.source_map().guess_head_span(tcx.hir().span_with_body(hir_id));
|
||||
tcx.struct_span_lint_hir(UNCONDITIONAL_RECURSION, hir_id, sp, |lint| {
|
||||
let mut db = lint.build("function cannot return without recursing");
|
||||
db.span_label(sp, "cannot return without recursing");
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue