hir: Remove fn opt_hir_id
and fn opt_span
This commit is contained in:
parent
363b098245
commit
a61019b290
44 changed files with 267 additions and 326 deletions
|
@ -2182,8 +2182,8 @@ impl<'tcx> TypeErrCtxt<'_, 'tcx> {
|
|||
if let Some(tykind) = tykind
|
||||
&& let hir::TyKind::Array(_, length) = tykind
|
||||
&& let hir::ArrayLen::Body(hir::AnonConst { hir_id, .. }) = length
|
||||
&& let Some(span) = self.tcx.hir().opt_span(*hir_id)
|
||||
{
|
||||
let span = self.tcx.hir().span(*hir_id);
|
||||
Some(TypeErrorAdditionalDiags::ConsiderSpecifyingLength { span, length: sz.found })
|
||||
} else {
|
||||
None
|
||||
|
|
|
@ -687,7 +687,7 @@ fn may_define_opaque_type(tcx: TyCtxt<'_>, def_id: LocalDefId, opaque_hir_id: hi
|
|||
let res = hir_id == scope;
|
||||
trace!(
|
||||
"may_define_opaque_type(def={:?}, opaque_node={:?}) = {}",
|
||||
tcx.opt_hir_node(hir_id),
|
||||
tcx.hir_node(hir_id),
|
||||
tcx.hir_node(opaque_hir_id),
|
||||
res
|
||||
);
|
||||
|
|
|
@ -5,7 +5,6 @@ use rustc_data_structures::fx::FxIndexSet;
|
|||
use rustc_errors::{codes::*, struct_span_code_err, Applicability, DiagnosticBuilder, MultiSpan};
|
||||
use rustc_hir as hir;
|
||||
use rustc_hir::def_id::{DefId, LocalDefId};
|
||||
use rustc_hir::intravisit::Map;
|
||||
use rustc_middle::ty::print::with_no_trimmed_paths;
|
||||
use rustc_middle::ty::{self, TyCtxt};
|
||||
use rustc_span::Span;
|
||||
|
@ -62,7 +61,7 @@ pub fn report_object_safety_error<'tcx>(
|
|||
err.span_label(span, format!("`{trait_str}` cannot be made into an object"));
|
||||
|
||||
if let Some(hir_id) = hir_id
|
||||
&& let Some(hir::Node::Ty(ty)) = tcx.hir().find(hir_id)
|
||||
&& let hir::Node::Ty(ty) = tcx.hir_node(hir_id)
|
||||
&& let hir::TyKind::TraitObject([trait_ref, ..], ..) = ty.kind
|
||||
{
|
||||
let mut hir_id = hir_id;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue