@@ -6,7 +6,7 @@ use rustc::hir;
6
6
use rustc:: hir:: def_id:: DefId ;
7
7
use rustc:: lint:: { in_external_macro, LateContext , LateLintPass , LintArray , LintContext , LintPass } ;
8
8
use rustc:: ty:: { self , Ty } ;
9
- use rustc:: util:: nodemap:: NodeSet ;
9
+ use rustc:: util:: nodemap:: HirIdSet ;
10
10
use rustc:: { declare_tool_lint, impl_lint_pass} ;
11
11
use rustc_errors:: Applicability ;
12
12
use syntax:: source_map:: Span ;
@@ -86,7 +86,7 @@ declare_clippy_lint! {
86
86
87
87
#[ derive( Clone , Default ) ]
88
88
pub struct NewWithoutDefault {
89
- impling_types : Option < NodeSet > ,
89
+ impling_types : Option < HirIdSet > ,
90
90
}
91
91
92
92
impl_lint_pass ! ( NewWithoutDefault => [ NEW_WITHOUT_DEFAULT ] ) ;
@@ -128,11 +128,11 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for NewWithoutDefault {
128
128
if let Some ( default_trait_id) = get_trait_def_id( cx, & paths:: DEFAULT_TRAIT ) ;
129
129
then {
130
130
if self . impling_types. is_none( ) {
131
- let mut impls = NodeSet :: default ( ) ;
131
+ let mut impls = HirIdSet :: default ( ) ;
132
132
cx. tcx. for_each_impl( default_trait_id, |d| {
133
133
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 ) ;
136
136
}
137
137
}
138
138
} ) ;
@@ -147,8 +147,7 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for NewWithoutDefault {
147
147
if self_def. did. is_local( ) ;
148
148
then {
149
149
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) {
152
151
return ;
153
152
}
154
153
}
0 commit comments