hir: Remove opt_local_def_id_to_hir_id and opt_hir_node_by_def_id
Also replace a few `hir_node()` calls with `hir_node_by_def_id()`
This commit is contained in:
@@ -1969,13 +1969,10 @@ impl<'tcx> WfCheckingCtxt<'_, 'tcx> {
|
||||
// Match the existing behavior.
|
||||
if pred.is_global() && !pred.has_type_flags(TypeFlags::HAS_BINDER_VARS) {
|
||||
let pred = self.normalize(span, None, pred);
|
||||
let hir_node = tcx.opt_hir_node_by_def_id(self.body_def_id);
|
||||
|
||||
// only use the span of the predicate clause (#90869)
|
||||
|
||||
if let Some(hir::Generics { predicates, .. }) =
|
||||
hir_node.and_then(|node| node.generics())
|
||||
{
|
||||
let hir_node = tcx.hir_node_by_def_id(self.body_def_id);
|
||||
if let Some(hir::Generics { predicates, .. }) = hir_node.generics() {
|
||||
span = predicates
|
||||
.iter()
|
||||
// There seems to be no better way to find out which predicate we are in
|
||||
|
||||
Reference in New Issue
Block a user