@@ -62,30 +62,30 @@ fn assert_ne() {
62
62
63
63
#[ test]
64
64
fn cfg ( ) {
65
- cfg ! ( pants) ;
66
- cfg ! ( pants, ) ;
67
- cfg ! ( pants = "pants" ) ;
68
- cfg ! ( pants = "pants" , ) ;
69
- cfg ! ( all( pants) ) ;
70
- cfg ! ( all( pants) , ) ;
71
- cfg ! ( all( pants, ) ) ;
72
- cfg ! ( all( pants, ) , ) ;
65
+ let _ = cfg ! ( pants) ;
66
+ let _ = cfg ! ( pants, ) ;
67
+ let _ = cfg ! ( pants = "pants" ) ;
68
+ let _ = cfg ! ( pants = "pants" , ) ;
69
+ let _ = cfg ! ( all( pants) ) ;
70
+ let _ = cfg ! ( all( pants) , ) ;
71
+ let _ = cfg ! ( all( pants, ) ) ;
72
+ let _ = cfg ! ( all( pants, ) , ) ;
73
73
}
74
74
75
75
#[ test]
76
76
fn column ( ) {
77
- column ! ( ) ;
77
+ let _ = column ! ( ) ;
78
78
}
79
79
80
80
// compile_error! is in a companion to this test in compile-fail
81
81
82
82
#[ test]
83
83
fn concat ( ) {
84
- concat ! ( ) ;
85
- concat ! ( "hello" ) ;
86
- concat ! ( "hello" , ) ;
87
- concat ! ( "hello" , " world" ) ;
88
- concat ! ( "hello" , " world" , ) ;
84
+ let _ = concat ! ( ) ;
85
+ let _ = concat ! ( "hello" ) ;
86
+ let _ = concat ! ( "hello" , ) ;
87
+ let _ = concat ! ( "hello" , " world" ) ;
88
+ let _ = concat ! ( "hello" , " world" , ) ;
89
89
}
90
90
91
91
#[ test]
@@ -131,10 +131,10 @@ fn debug_assert_ne() {
131
131
132
132
#[ test]
133
133
fn env ( ) {
134
- env ! ( "PATH" ) ;
135
- env ! ( "PATH" , ) ;
136
- env ! ( "PATH" , "not found" ) ;
137
- env ! ( "PATH" , "not found" , ) ;
134
+ let _ = env ! ( "PATH" ) ;
135
+ let _ = env ! ( "PATH" , ) ;
136
+ let _ = env ! ( "PATH" , "not found" ) ;
137
+ let _ = env ! ( "PATH" , "not found" , ) ;
138
138
}
139
139
140
140
#[ cfg( std) ]
@@ -158,58 +158,58 @@ fn eprintln() {
158
158
159
159
#[ test]
160
160
fn file ( ) {
161
- file ! ( ) ;
161
+ let _ = file ! ( ) ;
162
162
}
163
163
164
164
#[ cfg( std) ]
165
165
#[ test]
166
166
fn format ( ) {
167
- format ! ( "hello" ) ;
168
- format ! ( "hello" , ) ;
169
- format ! ( "hello {}" , "world" ) ;
170
- format ! ( "hello {}" , "world" , ) ;
167
+ let _ = format ! ( "hello" ) ;
168
+ let _ = format ! ( "hello" , ) ;
169
+ let _ = format ! ( "hello {}" , "world" ) ;
170
+ let _ = format ! ( "hello {}" , "world" , ) ;
171
171
}
172
172
173
173
#[ test]
174
174
fn format_args ( ) {
175
- format_args ! ( "hello" ) ;
176
- format_args ! ( "hello" , ) ;
177
- format_args ! ( "hello {}" , "world" ) ;
178
- format_args ! ( "hello {}" , "world" , ) ;
175
+ let _ = format_args ! ( "hello" ) ;
176
+ let _ = format_args ! ( "hello" , ) ;
177
+ let _ = format_args ! ( "hello {}" , "world" ) ;
178
+ let _ = format_args ! ( "hello {}" , "world" , ) ;
179
179
}
180
180
181
181
#[ test]
182
182
fn include ( ) {
183
- include ! ( "auxiliary/macro-comma-support.rs" ) ;
184
- include ! ( "auxiliary/macro-comma-support.rs" , ) ;
183
+ let _ = include ! ( "auxiliary/macro-comma-support.rs" ) ;
184
+ let _ = include ! ( "auxiliary/macro-comma-support.rs" , ) ;
185
185
}
186
186
187
187
#[ test]
188
188
fn include_bytes ( ) {
189
- include_bytes ! ( "auxiliary/macro-comma-support.rs" ) ;
190
- include_bytes ! ( "auxiliary/macro-comma-support.rs" , ) ;
189
+ let _ = include_bytes ! ( "auxiliary/macro-comma-support.rs" ) ;
190
+ let _ = include_bytes ! ( "auxiliary/macro-comma-support.rs" , ) ;
191
191
}
192
192
193
193
#[ test]
194
194
fn include_str ( ) {
195
- include_str ! ( "auxiliary/macro-comma-support.rs" ) ;
196
- include_str ! ( "auxiliary/macro-comma-support.rs" , ) ;
195
+ let _ = include_str ! ( "auxiliary/macro-comma-support.rs" ) ;
196
+ let _ = include_str ! ( "auxiliary/macro-comma-support.rs" , ) ;
197
197
}
198
198
199
199
#[ test]
200
200
fn line ( ) {
201
- line ! ( ) ;
201
+ let _ = line ! ( ) ;
202
202
}
203
203
204
204
#[ test]
205
205
fn module_path ( ) {
206
- module_path ! ( ) ;
206
+ let _ = module_path ! ( ) ;
207
207
}
208
208
209
209
#[ test]
210
210
fn option_env ( ) {
211
- option_env ! ( "PATH" ) ;
212
- option_env ! ( "PATH" , ) ;
211
+ let _ = option_env ! ( "PATH" ) ;
212
+ let _ = option_env ! ( "PATH" , ) ;
213
213
}
214
214
215
215
#[ test]
@@ -309,10 +309,10 @@ fn unreachable() {
309
309
#[ test]
310
310
fn vec ( ) {
311
311
let _: Vec < ( ) > = vec ! [ ] ;
312
- vec ! [ 0 ] ;
313
- vec ! [ 0 , ] ;
314
- vec ! [ 0 , 1 ] ;
315
- vec ! [ 0 , 1 , ] ;
312
+ let _ = vec ! [ 0 ] ;
313
+ let _ = vec ! [ 0 , ] ;
314
+ let _ = vec ! [ 0 , 1 ] ;
315
+ let _ = vec ! [ 0 , 1 , ] ;
316
316
}
317
317
318
318
// give a test body access to a fmt::Formatter, which seems
@@ -340,21 +340,21 @@ macro_rules! test_with_formatter {
340
340
test_with_formatter ! {
341
341
#[ test]
342
342
fn write( f: & mut fmt:: Formatter ) {
343
- write!( f, "hello" ) ;
344
- write!( f, "hello" , ) ;
345
- write!( f, "hello {}" , "world" ) ;
346
- write!( f, "hello {}" , "world" , ) ;
343
+ let _ = write!( f, "hello" ) ;
344
+ let _ = write!( f, "hello" , ) ;
345
+ let _ = write!( f, "hello {}" , "world" ) ;
346
+ let _ = write!( f, "hello {}" , "world" , ) ;
347
347
}
348
348
}
349
349
350
350
test_with_formatter ! {
351
351
#[ test]
352
352
fn writeln( f: & mut fmt:: Formatter ) {
353
- writeln!( f) ;
354
- writeln!( f, ) ;
355
- writeln!( f, "hello" ) ;
356
- writeln!( f, "hello" , ) ;
357
- writeln!( f, "hello {}" , "world" ) ;
358
- writeln!( f, "hello {}" , "world" , ) ;
353
+ let _ = writeln!( f) ;
354
+ let _ = writeln!( f, ) ;
355
+ let _ = writeln!( f, "hello" ) ;
356
+ let _ = writeln!( f, "hello" , ) ;
357
+ let _ = writeln!( f, "hello {}" , "world" ) ;
358
+ let _ = writeln!( f, "hello {}" , "world" , ) ;
359
359
}
360
360
}
0 commit comments