@@ -65,7 +65,7 @@ use std::sync::mpsc;
65
65
use std:: sync:: Arc ;
66
66
use std:: marker:: PhantomData ;
67
67
use rustc_target:: spec:: abi;
68
- use syntax:: ast:: { self , NodeId } ;
68
+ use syntax:: ast;
69
69
use syntax:: attr;
70
70
use syntax:: source_map:: MultiSpan ;
71
71
use syntax:: edition:: Edition ;
@@ -2836,14 +2836,6 @@ impl<'a, 'gcx, 'tcx> TyCtxt<'a, 'gcx, 'tcx> {
2836
2836
self . struct_span_lint_hir ( lint, hir_id, span. into ( ) , msg) . emit ( )
2837
2837
}
2838
2838
2839
- pub fn lint_node < S : Into < MultiSpan > > ( self ,
2840
- lint : & ' static Lint ,
2841
- id : NodeId ,
2842
- span : S ,
2843
- msg : & str ) {
2844
- self . struct_span_lint_node ( lint, id, span. into ( ) , msg) . emit ( )
2845
- }
2846
-
2847
2839
pub fn lint_hir_note < S : Into < MultiSpan > > ( self ,
2848
2840
lint : & ' static Lint ,
2849
2841
hir_id : HirId ,
@@ -2866,7 +2858,7 @@ impl<'a, 'gcx, 'tcx> TyCtxt<'a, 'gcx, 'tcx> {
2866
2858
err. emit ( )
2867
2859
}
2868
2860
2869
- pub fn lint_level_at_node ( self , lint : & ' static Lint , mut id : NodeId )
2861
+ pub fn lint_level_at_node ( self , lint : & ' static Lint , mut id : hir :: HirId )
2870
2862
-> ( lint:: Level , lint:: LintSource )
2871
2863
{
2872
2864
// Right now we insert a `with_ignore` node in the dep graph here to
@@ -2880,11 +2872,10 @@ impl<'a, 'gcx, 'tcx> TyCtxt<'a, 'gcx, 'tcx> {
2880
2872
self . dep_graph . with_ignore ( || {
2881
2873
let sets = self . lint_levels ( LOCAL_CRATE ) ;
2882
2874
loop {
2883
- let hir_id = self . hir ( ) . definitions ( ) . node_to_hir_id ( id) ;
2884
- if let Some ( pair) = sets. level_and_source ( lint, hir_id, self . sess ) {
2875
+ if let Some ( pair) = sets. level_and_source ( lint, id, self . sess ) {
2885
2876
return pair
2886
2877
}
2887
- let next = self . hir ( ) . get_parent_node ( id) ;
2878
+ let next = self . hir ( ) . get_parent_node_by_hir_id ( id) ;
2888
2879
if next == id {
2889
2880
bug ! ( "lint traversal reached the root of the crate" ) ;
2890
2881
}
@@ -2900,23 +2891,11 @@ impl<'a, 'gcx, 'tcx> TyCtxt<'a, 'gcx, 'tcx> {
2900
2891
msg : & str )
2901
2892
-> DiagnosticBuilder < ' tcx >
2902
2893
{
2903
- let node_id = self . hir ( ) . hir_to_node_id ( hir_id) ;
2904
- let ( level, src) = self . lint_level_at_node ( lint, node_id) ;
2905
- lint:: struct_lint_level ( self . sess , lint, level, src, Some ( span. into ( ) ) , msg)
2906
- }
2907
-
2908
- pub fn struct_span_lint_node < S : Into < MultiSpan > > ( self ,
2909
- lint : & ' static Lint ,
2910
- id : NodeId ,
2911
- span : S ,
2912
- msg : & str )
2913
- -> DiagnosticBuilder < ' tcx >
2914
- {
2915
- let ( level, src) = self . lint_level_at_node ( lint, id) ;
2894
+ let ( level, src) = self . lint_level_at_node ( lint, hir_id) ;
2916
2895
lint:: struct_lint_level ( self . sess , lint, level, src, Some ( span. into ( ) ) , msg)
2917
2896
}
2918
2897
2919
- pub fn struct_lint_node ( self , lint : & ' static Lint , id : NodeId , msg : & str )
2898
+ pub fn struct_lint_node ( self , lint : & ' static Lint , id : HirId , msg : & str )
2920
2899
-> DiagnosticBuilder < ' tcx >
2921
2900
{
2922
2901
let ( level, src) = self . lint_level_at_node ( lint, id) ;
0 commit comments