@@ -26,7 +26,7 @@ pub struct Cx<'a, 'gcx: 'a + 'tcx, 'tcx: 'a> {
26
26
tcx : TyCtxt < ' a , ' gcx , ' tcx > ,
27
27
infcx : & ' a InferCtxt < ' a , ' gcx , ' tcx > ,
28
28
29
- pub root_lint_level : ast :: NodeId ,
29
+ pub root_lint_level : hir :: HirId ,
30
30
pub param_env : ty:: ParamEnv < ' gcx > ,
31
31
32
32
/// Identity `Substs` for use with const-evaluation.
@@ -51,10 +51,10 @@ pub struct Cx<'a, 'gcx: 'a + 'tcx, 'tcx: 'a> {
51
51
52
52
impl < ' a , ' gcx , ' tcx > Cx < ' a , ' gcx , ' tcx > {
53
53
pub fn new ( infcx : & ' a InferCtxt < ' a , ' gcx , ' tcx > ,
54
- src_id : ast :: NodeId ) -> Cx < ' a , ' gcx , ' tcx > {
54
+ src_id : hir :: HirId ) -> Cx < ' a , ' gcx , ' tcx > {
55
55
let tcx = infcx. tcx ;
56
- let src_def_id = tcx. hir ( ) . local_def_id ( src_id) ;
57
- let body_owner_kind = tcx. hir ( ) . body_owner_kind ( src_id) ;
56
+ let src_def_id = tcx. hir ( ) . local_def_id_from_hir_id ( src_id) ;
57
+ let body_owner_kind = tcx. hir ( ) . body_owner_kind_by_hir_id ( src_id) ;
58
58
59
59
let constness = match body_owner_kind {
60
60
hir:: BodyOwnerKind :: Const |
@@ -63,7 +63,7 @@ impl<'a, 'gcx, 'tcx> Cx<'a, 'gcx, 'tcx> {
63
63
hir:: BodyOwnerKind :: Fn => hir:: Constness :: NotConst ,
64
64
} ;
65
65
66
- let attrs = tcx. hir ( ) . attrs ( src_id) ;
66
+ let attrs = tcx. hir ( ) . attrs_by_hir_id ( src_id) ;
67
67
68
68
// Some functions always have overflow checks enabled,
69
69
// however, they may not get codegen'd, depending on
@@ -204,7 +204,7 @@ impl<'a, 'gcx, 'tcx> Cx<'a, 'gcx, 'tcx> {
204
204
} ) ;
205
205
206
206
if has_lint_level {
207
- LintLevel :: Explicit ( node_id )
207
+ LintLevel :: Explicit ( hir_id )
208
208
} else {
209
209
LintLevel :: Inherited
210
210
}
@@ -237,7 +237,7 @@ impl UserAnnotatedTyHelpers<'gcx, 'tcx> for Cx<'_, 'gcx, 'tcx> {
237
237
}
238
238
}
239
239
240
- fn lint_level_for_hir_id ( tcx : TyCtxt < ' _ , ' _ , ' _ > , mut id : ast :: NodeId ) -> ast :: NodeId {
240
+ fn lint_level_for_hir_id ( tcx : TyCtxt < ' _ , ' _ , ' _ > , mut id : hir :: HirId ) -> hir :: HirId {
241
241
// Right now we insert a `with_ignore` node in the dep graph here to
242
242
// ignore the fact that `lint_levels` below depends on the entire crate.
243
243
// For now this'll prevent false positives of recompiling too much when
@@ -249,11 +249,10 @@ fn lint_level_for_hir_id(tcx: TyCtxt<'_, '_, '_>, mut id: ast::NodeId) -> ast::N
249
249
tcx. dep_graph . with_ignore ( || {
250
250
let sets = tcx. lint_levels ( LOCAL_CRATE ) ;
251
251
loop {
252
- let hir_id = tcx. hir ( ) . definitions ( ) . node_to_hir_id ( id) ;
253
- if sets. lint_level_set ( hir_id) . is_some ( ) {
252
+ if sets. lint_level_set ( id) . is_some ( ) {
254
253
return id
255
254
}
256
- let next = tcx. hir ( ) . get_parent_node ( id) ;
255
+ let next = tcx. hir ( ) . get_parent_node_by_hir_id ( id) ;
257
256
if next == id {
258
257
bug ! ( "lint traversal reached the root of the crate" ) ;
259
258
}
0 commit comments