@@ -56,10 +56,9 @@ declare_lint! {
56
56
"suggest using `loop { }` instead of `while true { }`"
57
57
}
58
58
59
+ #[ deriving( Copy ) ]
59
60
pub struct WhileTrue ;
60
61
61
- impl Copy for WhileTrue { }
62
-
63
62
impl LintPass for WhileTrue {
64
63
fn get_lints ( & self ) -> LintArray {
65
64
lint_array ! ( WHILE_TRUE )
@@ -83,10 +82,9 @@ declare_lint! {
83
82
"detects unnecessary type casts that can be removed"
84
83
}
85
84
85
+ #[ deriving( Copy ) ]
86
86
pub struct UnusedCasts ;
87
87
88
- impl Copy for UnusedCasts { }
89
-
90
88
impl LintPass for UnusedCasts {
91
89
fn get_lints ( & self ) -> LintArray {
92
90
lint_array ! ( UNUSED_TYPECASTS )
@@ -126,13 +124,12 @@ declare_lint! {
126
124
"shift exceeds the type's number of bits"
127
125
}
128
126
127
+ #[ deriving( Copy ) ]
129
128
pub struct TypeLimits {
130
129
/// Id of the last visited negated expression
131
130
negated_expr_id : ast:: NodeId ,
132
131
}
133
132
134
- impl Copy for TypeLimits { }
135
-
136
133
impl TypeLimits {
137
134
pub fn new ( ) -> TypeLimits {
138
135
TypeLimits {
@@ -442,10 +439,9 @@ impl<'a, 'tcx, 'v> Visitor<'v> for ImproperCTypesVisitor<'a, 'tcx> {
442
439
}
443
440
}
444
441
442
+ #[ deriving( Copy ) ]
445
443
pub struct ImproperCTypes ;
446
444
447
- impl Copy for ImproperCTypes { }
448
-
449
445
impl LintPass for ImproperCTypes {
450
446
fn get_lints ( & self ) -> LintArray {
451
447
lint_array ! ( IMPROPER_CTYPES )
@@ -486,10 +482,9 @@ declare_lint! {
486
482
"use of owned (Box type) heap memory"
487
483
}
488
484
485
+ #[ deriving( Copy ) ]
489
486
pub struct BoxPointers ;
490
487
491
- impl Copy for BoxPointers { }
492
-
493
488
impl BoxPointers {
494
489
fn check_heap_type < ' a , ' tcx > ( & self , cx : & Context < ' a , ' tcx > ,
495
490
span : Span , ty : Ty < ' tcx > ) {
@@ -627,10 +622,9 @@ declare_lint! {
627
622
"detects attributes that were not used by the compiler"
628
623
}
629
624
625
+ #[ deriving( Copy ) ]
630
626
pub struct UnusedAttributes ;
631
627
632
- impl Copy for UnusedAttributes { }
633
-
634
628
impl LintPass for UnusedAttributes {
635
629
fn get_lints ( & self ) -> LintArray {
636
630
lint_array ! ( UNUSED_ATTRIBUTES )
@@ -711,10 +705,9 @@ declare_lint! {
711
705
"path statements with no effect"
712
706
}
713
707
708
+ #[ deriving( Copy ) ]
714
709
pub struct PathStatements ;
715
710
716
- impl Copy for PathStatements { }
717
-
718
711
impl LintPass for PathStatements {
719
712
fn get_lints ( & self ) -> LintArray {
720
713
lint_array ! ( PATH_STATEMENTS )
@@ -746,10 +739,9 @@ declare_lint! {
746
739
"unused result of an expression in a statement"
747
740
}
748
741
742
+ #[ deriving( Copy ) ]
749
743
pub struct UnusedResults ;
750
744
751
- impl Copy for UnusedResults { }
752
-
753
745
impl LintPass for UnusedResults {
754
746
fn get_lints ( & self ) -> LintArray {
755
747
lint_array ! ( UNUSED_MUST_USE , UNUSED_RESULTS )
@@ -815,10 +807,9 @@ declare_lint! {
815
807
"types, variants, traits and type parameters should have camel case names"
816
808
}
817
809
810
+ #[ deriving( Copy ) ]
818
811
pub struct NonCamelCaseTypes ;
819
812
820
- impl Copy for NonCamelCaseTypes { }
821
-
822
813
impl NonCamelCaseTypes {
823
814
fn check_case ( & self , cx : & Context , sort : & str , ident : ast:: Ident , span : Span ) {
824
815
fn is_camel_case ( ident : ast:: Ident ) -> bool {
@@ -939,10 +930,9 @@ declare_lint! {
939
930
"methods, functions, lifetime parameters and modules should have snake case names"
940
931
}
941
932
933
+ #[ deriving( Copy ) ]
942
934
pub struct NonSnakeCase ;
943
935
944
- impl Copy for NonSnakeCase { }
945
-
946
936
impl NonSnakeCase {
947
937
fn check_snake_case ( & self , cx : & Context , sort : & str , ident : ast:: Ident , span : Span ) {
948
938
fn is_snake_case ( ident : ast:: Ident ) -> bool {
@@ -1053,10 +1043,9 @@ declare_lint! {
1053
1043
"static constants should have uppercase identifiers"
1054
1044
}
1055
1045
1046
+ #[ deriving( Copy ) ]
1056
1047
pub struct NonUpperCaseGlobals ;
1057
1048
1058
- impl Copy for NonUpperCaseGlobals { }
1059
-
1060
1049
impl LintPass for NonUpperCaseGlobals {
1061
1050
fn get_lints ( & self ) -> LintArray {
1062
1051
lint_array ! ( NON_UPPER_CASE_GLOBALS )
@@ -1107,10 +1096,9 @@ declare_lint! {
1107
1096
"`if`, `match`, `while` and `return` do not need parentheses"
1108
1097
}
1109
1098
1099
+ #[ deriving( Copy ) ]
1110
1100
pub struct UnusedParens ;
1111
1101
1112
- impl Copy for UnusedParens { }
1113
-
1114
1102
impl UnusedParens {
1115
1103
fn check_unused_parens_core ( & self , cx : & Context , value : & ast:: Expr , msg : & str ,
1116
1104
struct_lit_needs_parens : bool ) {
@@ -1202,10 +1190,9 @@ declare_lint! {
1202
1190
"unnecessary braces around an imported item"
1203
1191
}
1204
1192
1193
+ #[ deriving( Copy ) ]
1205
1194
pub struct UnusedImportBraces ;
1206
1195
1207
- impl Copy for UnusedImportBraces { }
1208
-
1209
1196
impl LintPass for UnusedImportBraces {
1210
1197
fn get_lints ( & self ) -> LintArray {
1211
1198
lint_array ! ( UNUSED_IMPORT_BRACES )
@@ -1242,10 +1229,9 @@ declare_lint! {
1242
1229
"using `Struct { x: x }` instead of `Struct { x }`"
1243
1230
}
1244
1231
1232
+ #[ deriving( Copy ) ]
1245
1233
pub struct NonShorthandFieldPatterns ;
1246
1234
1247
- impl Copy for NonShorthandFieldPatterns { }
1248
-
1249
1235
impl LintPass for NonShorthandFieldPatterns {
1250
1236
fn get_lints ( & self ) -> LintArray {
1251
1237
lint_array ! ( NON_SHORTHAND_FIELD_PATTERNS )
@@ -1276,10 +1262,9 @@ declare_lint! {
1276
1262
"unnecessary use of an `unsafe` block"
1277
1263
}
1278
1264
1265
+ #[ deriving( Copy ) ]
1279
1266
pub struct UnusedUnsafe ;
1280
1267
1281
- impl Copy for UnusedUnsafe { }
1282
-
1283
1268
impl LintPass for UnusedUnsafe {
1284
1269
fn get_lints ( & self ) -> LintArray {
1285
1270
lint_array ! ( UNUSED_UNSAFE )
@@ -1302,10 +1287,9 @@ declare_lint! {
1302
1287
"usage of an `unsafe` block"
1303
1288
}
1304
1289
1290
+ #[ deriving( Copy ) ]
1305
1291
pub struct UnsafeBlocks ;
1306
1292
1307
- impl Copy for UnsafeBlocks { }
1308
-
1309
1293
impl LintPass for UnsafeBlocks {
1310
1294
fn get_lints ( & self ) -> LintArray {
1311
1295
lint_array ! ( UNSAFE_BLOCKS )
@@ -1327,10 +1311,9 @@ declare_lint! {
1327
1311
"detect mut variables which don't need to be mutable"
1328
1312
}
1329
1313
1314
+ #[ deriving( Copy ) ]
1330
1315
pub struct UnusedMut ;
1331
1316
1332
- impl Copy for UnusedMut { }
1333
-
1334
1317
impl UnusedMut {
1335
1318
fn check_unused_mut_pat ( & self , cx : & Context , pats : & [ P < ast:: Pat > ] ) {
1336
1319
// collect all mutable pattern and group their NodeIDs by their Identifier to
@@ -1397,10 +1380,9 @@ declare_lint! {
1397
1380
"detects unnecessary allocations that can be eliminated"
1398
1381
}
1399
1382
1383
+ #[ deriving( Copy ) ]
1400
1384
pub struct UnusedAllocation ;
1401
1385
1402
- impl Copy for UnusedAllocation { }
1403
-
1404
1386
impl LintPass for UnusedAllocation {
1405
1387
fn get_lints ( & self ) -> LintArray {
1406
1388
lint_array ! ( UNUSED_ALLOCATION )
@@ -1589,10 +1571,9 @@ impl LintPass for MissingDoc {
1589
1571
}
1590
1572
}
1591
1573
1574
+ #[ deriving( Copy ) ]
1592
1575
pub struct MissingCopyImplementations ;
1593
1576
1594
- impl Copy for MissingCopyImplementations { }
1595
-
1596
1577
impl LintPass for MissingCopyImplementations {
1597
1578
fn get_lints ( & self ) -> LintArray {
1598
1579
lint_array ! ( MISSING_COPY_IMPLEMENTATIONS )
@@ -1665,10 +1646,9 @@ declare_lint! {
1665
1646
1666
1647
/// Checks for use of items with `#[deprecated]`, `#[experimental]` and
1667
1648
/// `#[unstable]` attributes, or no stability attribute.
1649
+ #[ deriving( Copy ) ]
1668
1650
pub struct Stability ;
1669
1651
1670
- impl Copy for Stability { }
1671
-
1672
1652
impl Stability {
1673
1653
fn lint ( & self , cx : & Context , id : ast:: DefId , span : Span ) {
1674
1654
let stability = stability:: lookup ( cx. tcx , id) ;
@@ -1903,10 +1883,9 @@ declare_lint!{
1903
1883
1904
1884
/// Does nothing as a lint pass, but registers some `Lint`s
1905
1885
/// which are used by other parts of the compiler.
1886
+ #[ deriving( Copy ) ]
1906
1887
pub struct HardwiredLints ;
1907
1888
1908
- impl Copy for HardwiredLints { }
1909
-
1910
1889
impl LintPass for HardwiredLints {
1911
1890
fn get_lints ( & self ) -> LintArray {
1912
1891
lint_array ! (
0 commit comments