Reduce use of local_def_id_to_hir_id.
This commit is contained in:
parent
ebcc847369
commit
67727aa7c3
39 changed files with 182 additions and 237 deletions
|
@ -99,12 +99,7 @@ fn are_inner_types_recursive<'tcx>(
|
|||
// Find non representable fields with their spans
|
||||
fold_repr(def.all_fields().map(|field| {
|
||||
let ty = field.ty(tcx, substs);
|
||||
let span = match field
|
||||
.did
|
||||
.as_local()
|
||||
.map(|id| tcx.hir().local_def_id_to_hir_id(id))
|
||||
.and_then(|id| tcx.hir().find(id))
|
||||
{
|
||||
let span = match field.did.as_local().and_then(|id| tcx.hir().find_by_def_id(id)) {
|
||||
Some(hir::Node::Field(field)) => field.ty.span,
|
||||
_ => sp,
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue