File tree 2 files changed +2
-36
lines changed
2 files changed +2
-36
lines changed Original file line number Diff line number Diff line change @@ -87,21 +87,5 @@ impl EarlyLintPass for StaticConst {
87
87
}
88
88
}
89
89
90
- fn check_trait_item ( & mut self , cx : & EarlyContext , item : & TraitItem ) {
91
- if !in_macro ( item. span ) {
92
- // Match only constants...
93
- if let TraitItemKind :: Const ( ref var_type, _) = item. node {
94
- self . visit_type ( var_type, cx) ;
95
- }
96
- }
97
- }
98
-
99
- fn check_impl_item ( & mut self , cx : & EarlyContext , item : & ImplItem ) {
100
- if !in_macro ( item. span ) {
101
- // Match only constants...
102
- if let ImplItemKind :: Const ( ref var_type, _) = item. node {
103
- self . visit_type ( var_type, cx) ;
104
- }
105
- }
106
- }
90
+ // Don't check associated consts because `'static` cannot be elided on those (issue #2438)
107
91
}
Original file line number Diff line number Diff line change @@ -78,23 +78,5 @@ error: Constants have by default a `'static` lifetime
78
78
24 | const VAR_ARRAY: &'static [u8; 1] = b"T"; // ERROR Consider removing 'static.
79
79
| -^^^^^^^-------- help: consider removing `'static`: `&[u8; 1]`
80
80
81
- error: Constants have by default a `'static` lifetime
82
- --> $DIR/const_static_lifetime.rs:40:23
83
- |
84
- 40 | const TRAIT_VAR: &'static str;
85
- | -^^^^^^^---- help: consider removing `'static`: `&str`
86
-
87
- error: Constants have by default a `'static` lifetime
88
- --> $DIR/const_static_lifetime.rs:44:22
89
- |
90
- 44 | const IMPL_VAR: &'static str = "var";
91
- | -^^^^^^^---- help: consider removing `'static`: `&str`
92
-
93
- error: Constants have by default a `'static` lifetime
94
- --> $DIR/const_static_lifetime.rs:48:23
95
- |
96
- 48 | const TRAIT_VAR: &'static str = "foo";
97
- | -^^^^^^^---- help: consider removing `'static`: `&str`
98
-
99
- error: aborting due to 16 previous errors
81
+ error: aborting due to 13 previous errors
100
82
You can’t perform that action at this time.
0 commit comments