Skip to content

Commit 73cb9ab

Browse files
committed
rename hir::map::get_by_hir_id to get
1 parent a64456e commit 73cb9ab

File tree

44 files changed

+88
-88
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

44 files changed

+88
-88
lines changed

src/librustc/hir/map/blocks.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ impl<'a> Code<'a> {
8484

8585
/// Attempts to construct a Code from presumed FnLike or Expr node input.
8686
pub fn from_node(map: &map::Map<'a>, id: ast::HirId) -> Option<Code<'a>> {
87-
match map.get_by_hir_id(id) {
87+
match map.get(id) {
8888
map::Node::Block(_) => {
8989
// Use the parent, hopefully an expression node.
9090
Code::from_node(map, map.get_parent_node_by_hir_id(id))

src/librustc/hir/map/mod.rs

+8-8
Original file line numberDiff line numberDiff line change
@@ -458,7 +458,7 @@ impl<'hir> Map<'hir> {
458458
}
459459

460460
pub fn body_owner_kind(&self, id: HirId) -> BodyOwnerKind {
461-
match self.get_by_hir_id(id) {
461+
match self.get(id) {
462462
Node::Item(&Item { node: ItemKind::Const(..), .. }) |
463463
Node::TraitItem(&TraitItem { node: TraitItemKind::Const(..), .. }) |
464464
Node::ImplItem(&ImplItem { node: ImplItemKind::Const(..), .. }) |
@@ -482,7 +482,7 @@ impl<'hir> Map<'hir> {
482482
}
483483

484484
pub fn ty_param_owner(&self, id: HirId) -> HirId {
485-
match self.get_by_hir_id(id) {
485+
match self.get(id) {
486486
Node::Item(&Item { node: ItemKind::Trait(..), .. }) |
487487
Node::Item(&Item { node: ItemKind::TraitAlias(..), .. }) => id,
488488
Node::GenericParam(_) => self.get_parent_node_by_hir_id(id),
@@ -491,7 +491,7 @@ impl<'hir> Map<'hir> {
491491
}
492492

493493
pub fn ty_param_name(&self, id: HirId) -> Name {
494-
match self.get_by_hir_id(id) {
494+
match self.get(id) {
495495
Node::Item(&Item { node: ItemKind::Trait(..), .. }) |
496496
Node::Item(&Item { node: ItemKind::TraitAlias(..), .. }) => kw::SelfUpper,
497497
Node::GenericParam(param) => param.name.ident().name,
@@ -561,14 +561,14 @@ impl<'hir> Map<'hir> {
561561
}
562562

563563
/// Retrieves the `Node` corresponding to `id`, panicking if it cannot be found.
564-
pub fn get_by_hir_id(&self, id: HirId) -> Node<'hir> {
564+
pub fn get(&self, id: HirId) -> Node<'hir> {
565565
// read recorded by `find`
566566
self.find_by_hir_id(id).unwrap_or_else(||
567567
bug!("couldn't find hir id {} in the HIR map", id))
568568
}
569569

570570
pub fn get_if_local(&self, id: DefId) -> Option<Node<'hir>> {
571-
self.as_local_hir_id(id).map(|id| self.get_by_hir_id(id)) // read recorded by `get`
571+
self.as_local_hir_id(id).map(|id| self.get(id)) // read recorded by `get`
572572
}
573573

574574
pub fn get_generics(&self, id: DefId) -> Option<&'hir Generics> {
@@ -840,7 +840,7 @@ impl<'hir> Map<'hir> {
840840
if scope == CRATE_HIR_ID {
841841
return Some(CRATE_HIR_ID);
842842
}
843-
match self.get_by_hir_id(scope) {
843+
match self.get(scope) {
844844
Node::Item(i) => {
845845
match i.node {
846846
ItemKind::Existential(ExistTy { impl_trait_fn: None, .. }) => {}
@@ -929,7 +929,7 @@ impl<'hir> Map<'hir> {
929929
}
930930

931931
pub fn name(&self, id: HirId) -> Name {
932-
match self.get_by_hir_id(id) {
932+
match self.get(id) {
933933
Node::Item(i) => i.ident.name,
934934
Node::ForeignItem(fi) => fi.ident.name,
935935
Node::ImplItem(ii) => ii.ident.name,
@@ -1061,7 +1061,7 @@ impl<'hir> Map<'hir> {
10611061
}
10621062

10631063
pub fn hir_to_pretty_string(&self, id: HirId) -> String {
1064-
print::to_string(self, |s| s.print_node(self.get_by_hir_id(id)))
1064+
print::to_string(self, |s| s.print_node(self.get(id)))
10651065
}
10661066
}
10671067

src/librustc/infer/error_reporting/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1335,7 +1335,7 @@ impl<'a, 'tcx> InferCtxt<'a, 'tcx> {
13351335
// We do this to avoid suggesting code that ends up as `T: 'a'b`,
13361336
// instead we suggest `T: 'a + 'b` in that case.
13371337
let mut has_bounds = false;
1338-
if let Node::GenericParam(ref param) = hir.get_by_hir_id(id) {
1338+
if let Node::GenericParam(ref param) = hir.get(id) {
13391339
has_bounds = !param.bounds.is_empty();
13401340
}
13411341
let sp = hir.span(id);

src/librustc/infer/error_reporting/nice_region_error/find_anon_type.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ impl<'a, 'tcx> NiceRegionError<'a, 'tcx> {
2929
if let Some(anon_reg) = self.tcx().is_suitable_region(region) {
3030
let def_id = anon_reg.def_id;
3131
if let Some(hir_id) = self.tcx().hir().as_local_hir_id(def_id) {
32-
let fndecl = match self.tcx().hir().get_by_hir_id(hir_id) {
32+
let fndecl = match self.tcx().hir().get(hir_id) {
3333
Node::Item(&hir::Item {
3434
node: hir::ItemKind::Fn(ref fndecl, ..),
3535
..

src/librustc/infer/error_reporting/nice_region_error/outlives_closure.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ impl<'a, 'tcx> NiceRegionError<'a, 'tcx> {
5252
if let Node::Expr(Expr {
5353
node: Closure(_, _, _, closure_span, None),
5454
..
55-
}) = hir.get_by_hir_id(hir_id) {
55+
}) = hir.get(hir_id) {
5656
let sup_sp = sup_origin.span();
5757
let origin_sp = origin.span();
5858
let mut err = self.tcx().sess.struct_span_err(

src/librustc/infer/opaque_types/mod.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -945,8 +945,8 @@ pub fn may_define_existential_type(
945945
let mut hir_id = tcx.hir().as_local_hir_id(def_id).unwrap();
946946
trace!(
947947
"may_define_existential_type(def={:?}, opaque_node={:?})",
948-
tcx.hir().get_by_hir_id(hir_id),
949-
tcx.hir().get_by_hir_id(opaque_hir_id)
948+
tcx.hir().get(hir_id),
949+
tcx.hir().get(opaque_hir_id)
950950
);
951951

952952
// Named existential types can be defined by any siblings or children of siblings.

src/librustc/middle/liveness.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1630,7 +1630,7 @@ impl<'a, 'tcx> Liveness<'a, 'tcx> {
16301630
);
16311631

16321632
if self.ir.variable_is_shorthand(var) {
1633-
if let Node::Binding(pat) = self.ir.tcx.hir().get_by_hir_id(hir_id) {
1633+
if let Node::Binding(pat) = self.ir.tcx.hir().get(hir_id) {
16341634
// Handle `ref` and `ref mut`.
16351635
let spans = spans.iter()
16361636
.map(|_span| (pat.span, format!("{}: _", name)))

src/librustc/middle/mem_categorization.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -344,7 +344,7 @@ impl MutabilityCategory {
344344
tables: &ty::TypeckTables<'_>,
345345
id: hir::HirId,
346346
) -> MutabilityCategory {
347-
let ret = match tcx.hir().get_by_hir_id(id) {
347+
let ret = match tcx.hir().get(id) {
348348
Node::Binding(p) => match p.node {
349349
PatKind::Binding(..) => {
350350
let bm = *tables.pat_binding_modes()

src/librustc/middle/region.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,7 @@ impl Scope {
190190
}
191191
let span = tcx.hir().span(hir_id);
192192
if let ScopeData::Remainder(first_statement_index) = self.data {
193-
if let Node::Block(ref blk) = tcx.hir().get_by_hir_id(hir_id) {
193+
if let Node::Block(ref blk) = tcx.hir().get(hir_id) {
194194
// Want span for scope starting after the
195195
// indexed statement and ending at end of
196196
// `blk`; reuse span of `blk` and shift `lo`
@@ -1368,7 +1368,7 @@ fn region_scope_tree<'tcx>(tcx: TyCtxt<'tcx>, def_id: DefId) -> &'tcx ScopeTree
13681368
// If the item is an associated const or a method,
13691369
// record its impl/trait parent, as it can also have
13701370
// lifetime parameters free in this body.
1371-
match tcx.hir().get_by_hir_id(id) {
1371+
match tcx.hir().get(id) {
13721372
Node::ImplItem(_) |
13731373
Node::TraitItem(_) => {
13741374
visitor.scope_tree.root_parent = Some(tcx.hir().get_parent_item(id));

src/librustc/middle/resolve_lifetime.rs

+5-5
Original file line numberDiff line numberDiff line change
@@ -1488,7 +1488,7 @@ impl<'a, 'tcx> LifetimeContext<'a, 'tcx> {
14881488
}
14891489
}
14901490
};
1491-
if let Node::Lifetime(hir_lifetime) = self.tcx.hir().get_by_hir_id(lifetime.hir_id) {
1491+
if let Node::Lifetime(hir_lifetime) = self.tcx.hir().get(lifetime.hir_id) {
14921492
if let Some(parent) = self.tcx.hir().find_by_hir_id(
14931493
self.tcx.hir().get_parent_item(hir_lifetime.hir_id))
14941494
{
@@ -1569,7 +1569,7 @@ impl<'a, 'tcx> LifetimeContext<'a, 'tcx> {
15691569
Some(LifetimeUseSet::One(lifetime)) => {
15701570
let hir_id = self.tcx.hir().as_local_hir_id(def_id).unwrap();
15711571
debug!("hir id first={:?}", hir_id);
1572-
if let Some((id, span, name)) = match self.tcx.hir().get_by_hir_id(hir_id) {
1572+
if let Some((id, span, name)) = match self.tcx.hir().get(hir_id) {
15731573
Node::Lifetime(hir_lifetime) => Some((
15741574
hir_lifetime.hir_id,
15751575
hir_lifetime.span,
@@ -1620,7 +1620,7 @@ impl<'a, 'tcx> LifetimeContext<'a, 'tcx> {
16201620
}
16211621
None => {
16221622
let hir_id = self.tcx.hir().as_local_hir_id(def_id).unwrap();
1623-
if let Some((id, span, name)) = match self.tcx.hir().get_by_hir_id(hir_id) {
1623+
if let Some((id, span, name)) = match self.tcx.hir().get(hir_id) {
16241624
Node::Lifetime(hir_lifetime) => Some((
16251625
hir_lifetime.hir_id,
16261626
hir_lifetime.span,
@@ -1823,7 +1823,7 @@ impl<'a, 'tcx> LifetimeContext<'a, 'tcx> {
18231823
// Do not free early-bound regions, only late-bound ones.
18241824
} else if let Some(body_id) = outermost_body {
18251825
let fn_id = self.tcx.hir().body_owner(body_id);
1826-
match self.tcx.hir().get_by_hir_id(fn_id) {
1826+
match self.tcx.hir().get(fn_id) {
18271827
Node::Item(&hir::Item {
18281828
node: hir::ItemKind::Fn(..),
18291829
..
@@ -2052,7 +2052,7 @@ impl<'a, 'tcx> LifetimeContext<'a, 'tcx> {
20522052
let mut assoc_item_kind = None;
20532053
let mut impl_self = None;
20542054
let parent = self.tcx.hir().get_parent_node_by_hir_id(output.hir_id);
2055-
let body = match self.tcx.hir().get_by_hir_id(parent) {
2055+
let body = match self.tcx.hir().get(parent) {
20562056
// `fn` definitions and methods.
20572057
Node::Item(&hir::Item {
20582058
node: hir::ItemKind::Fn(.., body),

src/librustc/middle/stability.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -580,7 +580,7 @@ impl<'tcx> TyCtxt<'tcx> {
580580

581581
let mut diag = self.struct_span_lint_hir(lint, id, span, &msg);
582582
if let Some(suggestion) = suggestion {
583-
if let hir::Node::Expr(_) = self.hir().get_by_hir_id(id) {
583+
if let hir::Node::Expr(_) = self.hir().get(id) {
584584
diag.span_suggestion(
585585
span,
586586
"replace the use of the deprecated item",

src/librustc/ty/constness.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ pub fn provide<'tcx>(providers: &mut Providers<'tcx>) {
7373
let hir_id = tcx.hir().as_local_hir_id(def_id)
7474
.expect("Non-local call to local provider is_const_fn");
7575

76-
let node = tcx.hir().get_by_hir_id(hir_id);
76+
let node = tcx.hir().get(hir_id);
7777
if let Some(fn_like) = FnLikeNode::from_node(node) {
7878
fn_like.constness() == hir::Constness::Const
7979
} else if let hir::Node::Ctor(_) = node {

src/librustc/ty/context.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1610,7 +1610,7 @@ impl<'tcx> TyCtxt<'tcx> {
16101610
) -> Option<Ty<'tcx>> {
16111611
// HACK: `type_of_def_id()` will fail on these (#55796), so return None
16121612
let hir_id = self.hir().as_local_hir_id(scope_def_id).unwrap();
1613-
match self.hir().get_by_hir_id(hir_id) {
1613+
match self.hir().get(hir_id) {
16141614
Node::Item(item) => {
16151615
match item.node {
16161616
ItemKind::Fn(..) => { /* type_of_def_id() will work */ }

src/librustc/ty/mod.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -2791,7 +2791,7 @@ impl<'tcx> TyCtxt<'tcx> {
27912791

27922792
pub fn opt_associated_item(self, def_id: DefId) -> Option<AssocItem> {
27932793
let is_associated_item = if let Some(hir_id) = self.hir().as_local_hir_id(def_id) {
2794-
match self.hir().get_by_hir_id(hir_id) {
2794+
match self.hir().get(hir_id) {
27952795
Node::TraitItem(_) | Node::ImplItem(_) => true,
27962796
_ => false,
27972797
}
@@ -3213,7 +3213,7 @@ fn trait_of_item<'tcx>(tcx: TyCtxt<'tcx>, def_id: DefId) -> Option<DefId> {
32133213
/// Yields the parent function's `DefId` if `def_id` is an `impl Trait` definition.
32143214
pub fn is_impl_trait_defn(tcx: TyCtxt<'_>, def_id: DefId) -> Option<DefId> {
32153215
if let Some(hir_id) = tcx.hir().as_local_hir_id(def_id) {
3216-
if let Node::Item(item) = tcx.hir().get_by_hir_id(hir_id) {
3216+
if let Node::Item(item) = tcx.hir().get(hir_id) {
32173217
if let hir::ItemKind::Existential(ref exist_ty) = item.node {
32183218
return exist_ty.impl_trait_fn;
32193219
}

src/librustc_borrowck/borrowck/check_loans.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,7 @@ pub fn check_loans<'a, 'tcx>(
191191
let def_id = bccx.tcx.hir().body_owner_def_id(body.id());
192192

193193
let hir_id = bccx.tcx.hir().as_local_hir_id(def_id).unwrap();
194-
let movable_generator = !match bccx.tcx.hir().get_by_hir_id(hir_id) {
194+
let movable_generator = !match bccx.tcx.hir().get(hir_id) {
195195
Node::Expr(&hir::Expr {
196196
node: hir::ExprKind::Closure(.., Some(hir::GeneratorMovability::Static)),
197197
..

src/librustc_borrowck/borrowck/gather_loans/gather_moves.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ fn get_pattern_source<'tcx>(tcx: TyCtxt<'tcx>, pat: &Pat) -> PatternSource<'tcx>
4949

5050
let parent = tcx.hir().get_parent_node_by_hir_id(pat.hir_id);
5151

52-
match tcx.hir().get_by_hir_id(parent) {
52+
match tcx.hir().get(parent) {
5353
Node::Expr(ref e) => {
5454
// the enclosing expression must be a `match` or something else
5555
assert!(match e.node {

src/librustc_borrowck/borrowck/mod.rs

+6-6
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ fn borrowck<'tcx>(tcx: TyCtxt<'tcx>, owner_def_id: DefId) -> &'tcx BorrowCheckRe
8080

8181
let owner_id = tcx.hir().as_local_hir_id(owner_def_id).unwrap();
8282

83-
match tcx.hir().get_by_hir_id(owner_id) {
83+
match tcx.hir().get(owner_id) {
8484
Node::Ctor(..) => {
8585
// We get invoked with anything that has MIR, but some of
8686
// those things (notably the synthesized constructors from
@@ -390,7 +390,7 @@ pub enum LoanPathElem<'tcx> {
390390

391391
fn closure_to_block(closure_id: LocalDefId, tcx: TyCtxt<'_>) -> HirId {
392392
let closure_id = tcx.hir().local_def_id_to_hir_id(closure_id);
393-
match tcx.hir().get_by_hir_id(closure_id) {
393+
match tcx.hir().get(closure_id) {
394394
Node::Expr(expr) => match expr.node {
395395
hir::ExprKind::Closure(.., body_id, _, _) => {
396396
body_id.hir_id
@@ -896,7 +896,7 @@ impl BorrowckCtxt<'_, 'tcx> {
896896
// to implement two traits for "one operator" is not very intuitive for
897897
// many programmers.
898898
if err.cmt.note == mc::NoteIndex {
899-
let node = self.tcx.hir().get_by_hir_id(err.cmt.hir_id);
899+
let node = self.tcx.hir().get(err.cmt.hir_id);
900900

901901
// This pattern probably always matches.
902902
if let Node::Expr(
@@ -1172,7 +1172,7 @@ impl BorrowckCtxt<'_, 'tcx> {
11721172
}
11731173

11741174
fn local_binding_mode(&self, hir_id: hir::HirId) -> ty::BindingMode {
1175-
let pat = match self.tcx.hir().get_by_hir_id(hir_id) {
1175+
let pat = match self.tcx.hir().get(hir_id) {
11761176
Node::Binding(pat) => pat,
11771177
node => bug!("bad node for local: {:?}", node)
11781178
};
@@ -1190,7 +1190,7 @@ impl BorrowckCtxt<'_, 'tcx> {
11901190

11911191
fn local_ty(&self, hir_id: hir::HirId) -> (Option<&hir::Ty>, bool) {
11921192
let parent = self.tcx.hir().get_parent_node_by_hir_id(hir_id);
1193-
let parent_node = self.tcx.hir().get_by_hir_id(parent);
1193+
let parent_node = self.tcx.hir().get(parent);
11941194

11951195
// The parent node is like a fn
11961196
if let Some(fn_like) = FnLikeNode::from_node(parent_node) {
@@ -1255,7 +1255,7 @@ impl BorrowckCtxt<'_, 'tcx> {
12551255
None => return
12561256
};
12571257

1258-
if let Node::Field(ref field) = self.tcx.hir().get_by_hir_id(hir_id) {
1258+
if let Node::Field(ref field) = self.tcx.hir().get(hir_id) {
12591259
if let Some(msg) = self.suggest_mut_for_immutable(&field.ty, false) {
12601260
db.span_label(field.ty.span, msg);
12611261
}

src/librustc_codegen_llvm/consts.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -208,7 +208,7 @@ impl CodegenCx<'ll, 'tcx> {
208208
let g = if let Some(id) = self.tcx.hir().as_local_hir_id(def_id) {
209209

210210
let llty = self.layout_of(ty).llvm_type(self);
211-
let (g, attrs) = match self.tcx.hir().get_by_hir_id(id) {
211+
let (g, attrs) = match self.tcx.hir().get(id) {
212212
Node::Item(&hir::Item {
213213
ref attrs, span, node: hir::ItemKind::Static(..), ..
214214
}) => {

src/librustc_codegen_ssa/back/symbol_export.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ fn reachable_non_generics_provider<'tcx>(
8282
//
8383
// As a result, if this id is an FFI item (foreign item) then we only
8484
// let it through if it's included statically.
85-
match tcx.hir().get_by_hir_id(hir_id) {
85+
match tcx.hir().get(hir_id) {
8686
Node::ForeignItem(..) => {
8787
let def_id = tcx.hir().local_def_id_from_hir_id(hir_id);
8888
if tcx.is_statically_included_foreign_item(def_id) {

src/librustc_codegen_utils/symbol_names.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ fn symbol_name(tcx: TyCtxt<'tcx>, instance: Instance<'tcx>) -> InternedString {
135135

136136
// FIXME(eddyb) Precompute a custom symbol name based on attributes.
137137
let is_foreign = if let Some(id) = hir_id {
138-
match tcx.hir().get_by_hir_id(id) {
138+
match tcx.hir().get(id) {
139139
Node::ForeignItem(_) => true,
140140
_ => false,
141141
}

src/librustc_driver/pretty.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -627,7 +627,7 @@ fn print_flowgraph<'tcx, W: Write>(
627627
// Find the function this expression is from.
628628
let mut hir_id = expr.hir_id;
629629
loop {
630-
let node = tcx.hir().get_by_hir_id(hir_id);
630+
let node = tcx.hir().get(hir_id);
631631
if let Some(n) = hir::map::blocks::FnLikeNode::from_node(node) {
632632
break n.body();
633633
}
@@ -831,7 +831,7 @@ pub fn print_after_hir_lowering<'tcx>(
831831
annotation.pp_ann());
832832
for node_id in uii.all_matching_node_ids(hir_map) {
833833
let hir_id = tcx.hir().node_to_hir_id(node_id);
834-
let node = hir_map.get_by_hir_id(hir_id);
834+
let node = hir_map.get(hir_id);
835835
pp_state.print_node(node)?;
836836
pp_state.s.space()?;
837837
let path = annotation.node_path(node_id)
@@ -849,7 +849,7 @@ pub fn print_after_hir_lowering<'tcx>(
849849
debug!("pretty printing source code {:?}", s);
850850
for node_id in uii.all_matching_node_ids(tcx.hir()) {
851851
let hir_id = tcx.hir().node_to_hir_id(node_id);
852-
let node = tcx.hir().get_by_hir_id(hir_id);
852+
let node = tcx.hir().get(hir_id);
853853
write!(out, "{:#?}", node)?;
854854
}
855855
Ok(())

src/librustc_incremental/persist/dirty_clean.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -322,7 +322,7 @@ impl DirtyCleanVisitor<'tcx> {
322322
/// Return all DepNode labels that should be asserted for this item.
323323
/// index=0 is the "name" used for error messages
324324
fn auto_labels(&mut self, item_id: hir::HirId, attr: &Attribute) -> (&'static str, Labels) {
325-
let node = self.tcx.hir().get_by_hir_id(item_id);
325+
let node = self.tcx.hir().get(item_id);
326326
let (name, labels) = match node {
327327
HirNode::Item(item) => {
328328
match item.node {

src/librustc_lint/types.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -276,7 +276,7 @@ fn lint_int_literal<'a, 'tcx>(
276276
}
277277

278278
let par_id = cx.tcx.hir().get_parent_node_by_hir_id(e.hir_id);
279-
if let Node::Expr(par_e) = cx.tcx.hir().get_by_hir_id(par_id) {
279+
if let Node::Expr(par_e) = cx.tcx.hir().get(par_id) {
280280
if let hir::ExprKind::Struct(..) = par_e.node {
281281
if is_range_literal(cx.sess(), par_e)
282282
&& lint_overflowing_range_endpoint(cx, lit, v, max, e, par_e, t)
@@ -315,7 +315,7 @@ fn lint_uint_literal<'a, 'tcx>(
315315
};
316316
if lit_val < min || lit_val > max {
317317
let parent_id = cx.tcx.hir().get_parent_node_by_hir_id(e.hir_id);
318-
if let Node::Expr(par_e) = cx.tcx.hir().get_by_hir_id(parent_id) {
318+
if let Node::Expr(par_e) = cx.tcx.hir().get(parent_id) {
319319
match par_e.node {
320320
hir::ExprKind::Cast(..) => {
321321
if let ty::Char = cx.tables.expr_ty(par_e).sty {

0 commit comments

Comments
 (0)