Skip to content

Commit 30ad2c1

Browse files
committed
Don't needlessly search for already-found HIR generic param
1 parent 7a89da3 commit 30ad2c1

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

compiler/rustc_hir_analysis/src/collect/resolve_bound_vars.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1064,8 +1064,6 @@ fn object_lifetime_default(tcx: TyCtxt<'_>, param_def_id: LocalDefId) -> ObjectL
10641064
hir::GenericParamSource::Generics => {
10651065
let parent_def_id = tcx.local_parent(param_def_id);
10661066
let generics = tcx.hir_get_generics(parent_def_id).unwrap();
1067-
let param_hir_id = tcx.local_def_id_to_hir_id(param_def_id);
1068-
let param = generics.params.iter().find(|p| p.hir_id == param_hir_id).unwrap();
10691067

10701068
// Scan the bounds and where-clauses on parameters to extract bounds
10711069
// of the form `T:'a` so as to determine the `ObjectLifetimeDefault`
@@ -1099,7 +1097,7 @@ fn object_lifetime_default(tcx: TyCtxt<'_>, param_def_id: LocalDefId) -> ObjectL
10991097
}
11001098
}
11011099
_ => {
1102-
bug!("object_lifetime_default_raw must only be called on a type parameter")
1100+
bug!("object_lifetime_default must only be called on a type parameter")
11031101
}
11041102
}
11051103
}

0 commit comments

Comments
 (0)