@@ -286,7 +286,9 @@ declare_lint_pass!(NonCopyConst => [DECLARE_INTERIOR_MUTABLE_CONST, BORROW_INTER
286
286
287
287
impl < ' tcx > LateLintPass < ' tcx > for NonCopyConst {
288
288
fn check_item ( & mut self , cx : & LateContext < ' tcx > , it : & ' tcx Item < ' _ > ) {
289
- if let ItemKind :: Const ( hir_ty, body_id) = it. kind {
289
+ if let ItemKind :: Const ( hir_ty, _generics, body_id) = it. kind {
290
+ // FIXME(generic_consts): Not sure if we need to handle generics explicitly here like
291
+ // replacing params with placeholders or can `is_unfrozen` handle params on its own?
290
292
let ty = hir_ty_to_ty ( cx. tcx , hir_ty) ;
291
293
if !ignored_macro ( cx, it) && is_unfrozen ( cx, ty) && is_value_unfrozen_poly ( cx, body_id, ty) {
292
294
lint ( cx, Source :: Item { item : it. span } ) ;
@@ -295,6 +297,7 @@ impl<'tcx> LateLintPass<'tcx> for NonCopyConst {
295
297
}
296
298
297
299
fn check_trait_item ( & mut self , cx : & LateContext < ' tcx > , trait_item : & ' tcx TraitItem < ' _ > ) {
300
+ // FIXME(generic_consts): Not sure if we need to handle generics explicitly here.
298
301
if let TraitItemKind :: Const ( hir_ty, body_id_opt) = & trait_item. kind {
299
302
let ty = hir_ty_to_ty ( cx. tcx , hir_ty) ;
300
303
@@ -322,6 +325,7 @@ impl<'tcx> LateLintPass<'tcx> for NonCopyConst {
322
325
}
323
326
324
327
fn check_impl_item ( & mut self , cx : & LateContext < ' tcx > , impl_item : & ' tcx ImplItem < ' _ > ) {
328
+ // FIXME(generic_consts): Not sure if we need to handle generics explicitly here
325
329
if let ImplItemKind :: Const ( hir_ty, body_id) = & impl_item. kind {
326
330
let item_def_id = cx. tcx . hir ( ) . get_parent_item ( impl_item. hir_id ( ) ) . def_id ;
327
331
let item = cx. tcx . hir ( ) . expect_item ( item_def_id) ;
0 commit comments