File tree 3 files changed +17
-9
lines changed 3 files changed +17
-9
lines changed Original file line number Diff line number Diff line change @@ -24,6 +24,7 @@ compiletest_rs = "0.0.11"
24
24
regex = " *"
25
25
regex_macros = " *"
26
26
lazy_static = " *"
27
+ rustc-serialize = " 0.3"
27
28
28
29
[features ]
29
30
Original file line number Diff line number Diff line change @@ -12,14 +12,6 @@ fn in_macro(_foo: u32) {
12
12
println ! ( "{}" , _foo) ; //~ ERROR used binding which is prefixed with an underscore
13
13
}
14
14
15
- // TODO: This doesn't actually correctly test this. Need to find a #[derive(...)] which sets off
16
- // the lint if the `in_attributes_expansion` test isn't there
17
- /// Test that we do not lint for unused underscores in a MacroAttribute expansion
18
- #[ derive( Clone ) ]
19
- struct MacroAttributesTest {
20
- _foo : u32 ,
21
- }
22
-
23
15
// Struct for testing use of fields prefixed with an underscore
24
16
struct StructFieldTest {
25
17
_underscore_field : u32 ,
@@ -76,7 +68,6 @@ fn non_variables() {
76
68
77
69
fn main ( ) {
78
70
let foo = 0u32 ;
79
- let _ = MacroAttributesTest { _foo : 0 } ;
80
71
// tests of unused_underscore lint
81
72
let _ = prefix_underscore ( foo) ;
82
73
in_macro ( foo) ;
Original file line number Diff line number Diff line change
1
+ #![ feature( plugin) ]
2
+ #![ plugin( clippy) ]
3
+
4
+ extern crate rustc_serialize;
5
+
6
+ /// Test that we do not lint for unused underscores in a MacroAttribute expansion
7
+ #[ deny( used_underscore_binding) ]
8
+ #[ derive( RustcEncodable ) ]
9
+ struct MacroAttributesTest {
10
+ _foo : u32 ,
11
+ }
12
+
13
+ #[ test]
14
+ fn macro_attributes_test ( ) {
15
+ let _ = MacroAttributesTest { _foo : 0 } ;
16
+ }
You can’t perform that action at this time.
0 commit comments