File tree Expand file tree Collapse file tree 2 files changed +1
-11
lines changed
src/tools/clippy/clippy_lints/src/utils Expand file tree Collapse file tree 2 files changed +1
-11
lines changed Original file line number Diff line number Diff line change @@ -1169,16 +1169,6 @@ pub enum StmtKind<'hir> {
1169
1169
Semi ( & ' hir Expr < ' hir > ) ,
1170
1170
}
1171
1171
1172
- impl < ' hir > StmtKind < ' hir > {
1173
- pub fn attrs ( & self , get_item : impl FnOnce ( ItemId ) -> & ' hir Item < ' hir > ) -> & ' hir [ Attribute ] {
1174
- match * self {
1175
- StmtKind :: Local ( ref l) => & l. attrs ,
1176
- StmtKind :: Item ( ref item_id) => & get_item ( * item_id) . attrs ,
1177
- StmtKind :: Expr ( ref e) | StmtKind :: Semi ( ref e) => & e. attrs ,
1178
- }
1179
- }
1180
- }
1181
-
1182
1172
/// Represents a `let` statement (i.e., `let <pat>:<ty> = <expr>;`).
1183
1173
#[ derive( Debug , HashStable_Generic ) ]
1184
1174
pub struct Local < ' hir > {
Original file line number Diff line number Diff line change @@ -109,7 +109,7 @@ impl<'tcx> LateLintPass<'tcx> for DeepCodeInspector {
109
109
}
110
110
111
111
fn check_stmt ( & mut self , cx : & LateContext < ' tcx > , stmt : & ' tcx hir:: Stmt < ' _ > ) {
112
- if !has_attr ( cx. sess ( ) , stmt . kind . attrs ( |id| cx. tcx . hir ( ) . item ( id ) ) ) {
112
+ if !has_attr ( cx. sess ( ) , cx. tcx . hir ( ) . attrs ( stmt . hir_id ) ) {
113
113
return ;
114
114
}
115
115
match stmt. kind {
You can’t perform that action at this time.
0 commit comments