Make body_owned_by return the body directly.
Almost all callers want this anyway, and now we can use it to also return fed bodies
This commit is contained in:
@@ -452,7 +452,7 @@ fn construct_fn<'tcx>(
|
||||
assert_eq!(expr.as_usize(), thir.exprs.len() - 1);
|
||||
|
||||
// Figure out what primary body this item has.
|
||||
let body_id = tcx.hir().body_owned_by(fn_def);
|
||||
let body = tcx.hir().body_owned_by(fn_def);
|
||||
let span_with_body = tcx.hir().span_with_body(fn_id);
|
||||
let return_ty_span = tcx
|
||||
.hir()
|
||||
@@ -512,9 +512,9 @@ fn construct_fn<'tcx>(
|
||||
);
|
||||
|
||||
let call_site_scope =
|
||||
region::Scope { id: body_id.hir_id.local_id, data: region::ScopeData::CallSite };
|
||||
region::Scope { id: body.id().hir_id.local_id, data: region::ScopeData::CallSite };
|
||||
let arg_scope =
|
||||
region::Scope { id: body_id.hir_id.local_id, data: region::ScopeData::Arguments };
|
||||
region::Scope { id: body.id().hir_id.local_id, data: region::ScopeData::Arguments };
|
||||
let source_info = builder.source_info(span);
|
||||
let call_site_s = (call_site_scope, source_info);
|
||||
unpack!(builder.in_scope(call_site_s, LintLevel::Inherited, |builder| {
|
||||
|
||||
Reference in New Issue
Block a user