@@ -65,7 +65,7 @@ use std::sync::mpsc;
6565use std:: sync:: Arc ;
6666use std:: marker:: PhantomData ;
6767use rustc_target:: spec:: abi;
68- use syntax:: ast:: { self , NodeId } ;
68+ use syntax:: ast;
6969use syntax:: attr;
7070use syntax:: source_map:: MultiSpan ;
7171use syntax:: edition:: Edition ;
@@ -2836,14 +2836,6 @@ impl<'a, 'gcx, 'tcx> TyCtxt<'a, 'gcx, 'tcx> {
28362836 self . struct_span_lint_hir ( lint, hir_id, span. into ( ) , msg) . emit ( )
28372837 }
28382838
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-
28472839 pub fn lint_hir_note < S : Into < MultiSpan > > ( self ,
28482840 lint : & ' static Lint ,
28492841 hir_id : HirId ,
@@ -2866,7 +2858,7 @@ impl<'a, 'gcx, 'tcx> TyCtxt<'a, 'gcx, 'tcx> {
28662858 err. emit ( )
28672859 }
28682860
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 )
28702862 -> ( lint:: Level , lint:: LintSource )
28712863 {
28722864 // 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> {
28802872 self . dep_graph . with_ignore ( || {
28812873 let sets = self . lint_levels ( LOCAL_CRATE ) ;
28822874 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 ) {
28852876 return pair
28862877 }
2887- let next = self . hir ( ) . get_parent_node ( id) ;
2878+ let next = self . hir ( ) . get_parent_node_by_hir_id ( id) ;
28882879 if next == id {
28892880 bug ! ( "lint traversal reached the root of the crate" ) ;
28902881 }
@@ -2900,23 +2891,11 @@ impl<'a, 'gcx, 'tcx> TyCtxt<'a, 'gcx, 'tcx> {
29002891 msg : & str )
29012892 -> DiagnosticBuilder < ' tcx >
29022893 {
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) ;
29162895 lint:: struct_lint_level ( self . sess , lint, level, src, Some ( span. into ( ) ) , msg)
29172896 }
29182897
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 )
29202899 -> DiagnosticBuilder < ' tcx >
29212900 {
29222901 let ( level, src) = self . lint_level_at_node ( lint, id) ;
0 commit comments