File tree Expand file tree Collapse file tree 3 files changed +6
-5
lines changed Expand file tree Collapse file tree 3 files changed +6
-5
lines changed Original file line number Diff line number Diff line change @@ -2526,7 +2526,7 @@ mod bitv_bench {
2526
2526
for _ in range ( 0 u, 100 ) {
2527
2527
bitv |= 1 << ( ( r. next_u32 ( ) as uint ) % u32:: BITS ) ;
2528
2528
}
2529
- black_box ( & bitv)
2529
+ black_box ( & bitv) ;
2530
2530
} ) ;
2531
2531
}
2532
2532
@@ -2538,7 +2538,7 @@ mod bitv_bench {
2538
2538
for _ in range ( 0 u, 100 ) {
2539
2539
bitv. set ( ( r. next_u32 ( ) as uint ) % BENCH_BITS , true ) ;
2540
2540
}
2541
- black_box ( & bitv)
2541
+ black_box ( & bitv) ;
2542
2542
} ) ;
2543
2543
}
2544
2544
Original file line number Diff line number Diff line change @@ -2841,7 +2841,7 @@ mod bench {
2841
2841
let s = "ศไทย中华Việt Nam; Mary had a little lamb, Little lamb" ;
2842
2842
2843
2843
b. iter ( || {
2844
- for ch in s. chars ( ) { black_box ( ch) }
2844
+ for ch in s. chars ( ) { black_box ( ch) ; }
2845
2845
} ) ;
2846
2846
}
2847
2847
@@ -2869,7 +2869,7 @@ mod bench {
2869
2869
let s = "ศไทย中华Việt Nam; Mary had a little lamb, Little lamb" ;
2870
2870
2871
2871
b. iter ( || {
2872
- for ch in s. chars ( ) . rev ( ) { black_box ( ch) }
2872
+ for ch in s. chars ( ) . rev ( ) { black_box ( ch) ; }
2873
2873
} ) ;
2874
2874
}
2875
2875
Original file line number Diff line number Diff line change @@ -1332,10 +1332,11 @@ impl MetricMap {
1332
1332
/// elimination.
1333
1333
///
1334
1334
/// This function is a no-op, and does not even read from `dummy`.
1335
- pub fn black_box < T > ( dummy : T ) {
1335
+ pub fn black_box < T > ( dummy : T ) -> T {
1336
1336
// we need to "use" the argument in some way LLVM can't
1337
1337
// introspect.
1338
1338
unsafe { asm ! ( "" : : "r" ( & dummy) ) }
1339
+ dummy
1339
1340
}
1340
1341
1341
1342
You can’t perform that action at this time.
0 commit comments