@@ -412,26 +412,16 @@ impl LintPass for CTypes {
412412 }
413413}
414414
415- declare_lint ! ( MANAGED_HEAP_MEMORY , Allow ,
416- "use of managed (@ type) heap memory" )
417-
418415declare_lint ! ( OWNED_HEAP_MEMORY , Allow ,
419416 "use of owned (Box type) heap memory" )
420417
421- declare_lint ! ( HEAP_MEMORY , Allow ,
422- "use of any (Box type or @ type) heap memory" )
423-
424418pub struct HeapMemory ;
425419
426420impl HeapMemory {
427421 fn check_heap_type ( & self , cx : & Context , span : Span , ty : ty:: t ) {
428- let mut n_box = 0 i;
429422 let mut n_uniq = 0 i;
430423 ty:: fold_ty ( cx. tcx , ty, |t| {
431424 match ty:: get ( t) . sty {
432- ty:: ty_box( _) => {
433- n_box += 1 ;
434- }
435425 ty:: ty_uniq( _) |
436426 ty:: ty_closure( box ty:: ClosureTy {
437427 store : ty:: UniqTraitStore ,
@@ -449,21 +439,13 @@ impl HeapMemory {
449439 let s = ty_to_string ( cx. tcx , ty) ;
450440 let m = format ! ( "type uses owned (Box type) pointers: {}" , s) ;
451441 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 ( ) ) ;
460442 }
461443 }
462444}
463445
464446impl LintPass for HeapMemory {
465447 fn get_lints ( & self ) -> LintArray {
466- lint_array ! ( MANAGED_HEAP_MEMORY , OWNED_HEAP_MEMORY , HEAP_MEMORY )
448+ lint_array ! ( OWNED_HEAP_MEMORY )
467449 }
468450
469451 fn check_item ( & mut self , cx : & Context , it : & ast:: Item ) {
0 commit comments