@@ -412,26 +412,16 @@ impl LintPass for CTypes {
412
412
}
413
413
}
414
414
415
- declare_lint ! ( MANAGED_HEAP_MEMORY , Allow ,
416
- "use of managed (@ type) heap memory" )
417
-
418
415
declare_lint ! ( OWNED_HEAP_MEMORY , Allow ,
419
416
"use of owned (Box type) heap memory" )
420
417
421
- declare_lint ! ( HEAP_MEMORY , Allow ,
422
- "use of any (Box type or @ type) heap memory" )
423
-
424
418
pub struct HeapMemory ;
425
419
426
420
impl HeapMemory {
427
421
fn check_heap_type ( & self , cx : & Context , span : Span , ty : ty:: t ) {
428
- let mut n_box = 0 i;
429
422
let mut n_uniq = 0 i;
430
423
ty:: fold_ty ( cx. tcx , ty, |t| {
431
424
match ty:: get ( t) . sty {
432
- ty:: ty_box( _) => {
433
- n_box += 1 ;
434
- }
435
425
ty:: ty_uniq( _) |
436
426
ty:: ty_closure( box ty:: ClosureTy {
437
427
store : ty:: UniqTraitStore ,
@@ -449,21 +439,13 @@ impl HeapMemory {
449
439
let s = ty_to_string ( cx. tcx , ty) ;
450
440
let m = format ! ( "type uses owned (Box type) pointers: {}" , s) ;
451
441
cx. span_lint ( OWNED_HEAP_MEMORY , span, m. as_slice ( ) ) ;
452
- cx. span_lint ( HEAP_MEMORY , span, m. as_slice ( ) ) ;
453
- }
454
-
455
- if n_box > 0 {
456
- let s = ty_to_string ( cx. tcx , ty) ;
457
- let m = format ! ( "type uses managed (@ type) pointers: {}" , s) ;
458
- cx. span_lint ( MANAGED_HEAP_MEMORY , span, m. as_slice ( ) ) ;
459
- cx. span_lint ( HEAP_MEMORY , span, m. as_slice ( ) ) ;
460
442
}
461
443
}
462
444
}
463
445
464
446
impl LintPass for HeapMemory {
465
447
fn get_lints ( & self ) -> LintArray {
466
- lint_array ! ( MANAGED_HEAP_MEMORY , OWNED_HEAP_MEMORY , HEAP_MEMORY )
448
+ lint_array ! ( OWNED_HEAP_MEMORY )
467
449
}
468
450
469
451
fn check_item ( & mut self , cx : & Context , it : & ast:: Item ) {
0 commit comments