@@ -6,7 +6,7 @@ use rustc::hir;
66use rustc:: hir:: def_id:: DefId ;
77use rustc:: lint:: { in_external_macro, LateContext , LateLintPass , LintArray , LintContext , LintPass } ;
88use rustc:: ty:: { self , Ty } ;
9- use rustc:: util:: nodemap:: NodeSet ;
9+ use rustc:: util:: nodemap:: HirIdSet ;
1010use rustc:: { declare_tool_lint, impl_lint_pass} ;
1111use rustc_errors:: Applicability ;
1212use syntax:: source_map:: Span ;
@@ -86,7 +86,7 @@ declare_clippy_lint! {
8686
8787#[ derive( Clone , Default ) ]
8888pub struct NewWithoutDefault {
89- impling_types : Option < NodeSet > ,
89+ impling_types : Option < HirIdSet > ,
9090}
9191
9292impl_lint_pass ! ( NewWithoutDefault => [ NEW_WITHOUT_DEFAULT ] ) ;
@@ -128,11 +128,11 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for NewWithoutDefault {
128128 if let Some ( default_trait_id) = get_trait_def_id( cx, & paths:: DEFAULT_TRAIT ) ;
129129 then {
130130 if self . impling_types. is_none( ) {
131- let mut impls = NodeSet :: default ( ) ;
131+ let mut impls = HirIdSet :: default ( ) ;
132132 cx. tcx. for_each_impl( default_trait_id, |d| {
133133 if let Some ( ty_def) = cx. tcx. type_of( d) . ty_adt_def( ) {
134- if let Some ( node_id ) = cx. tcx. hir( ) . as_local_node_id ( ty_def. did) {
135- impls. insert( node_id ) ;
134+ if let Some ( hir_id ) = cx. tcx. hir( ) . as_local_hir_id ( ty_def. did) {
135+ impls. insert( hir_id ) ;
136136 }
137137 }
138138 } ) ;
@@ -147,8 +147,7 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for NewWithoutDefault {
147147 if self_def. did. is_local( ) ;
148148 then {
149149 let self_id = cx. tcx. hir( ) . local_def_id_to_hir_id( self_def. did. to_local( ) ) ;
150- let node_id = cx. tcx. hir( ) . hir_to_node_id( self_id) ;
151- if impling_types. contains( & node_id) {
150+ if impling_types. contains( & self_id) {
152151 return ;
153152 }
154153 }
0 commit comments