Commit d50c1cd
committed
do not backdoor-enable backend-bitmap in unittests
The bitmap backend implementation in vm_memory::bitmap::backend is only
exported if the backend-bitmap feature is enabled. However, compiling
the crate in test mode (e.g. `cargo test`), also unconditionally enables
it. This is weird, and actually causes problems: The bitmap backend code
depends on the libc crate, and this weird "enable unconditionally for
tests" behavior means we have to go through more trouble in Cargo.toml
to get the code to compile in some feature combinations, as not only do
we need to add the libc crate as a dependency of the backend-bitmap
feature, we also have to add it as a dev-dependency.
Add a #[cfg(feature = "backend-bitmap")] to the test module in
src/bitmap/mod.rs, as otherwise some of the functions will be warned
about being unused in some feature configurations.
Signed-off-by: Patrick Roy <roypat@amazon.co.uk>1 parent 92874cc commit d50c1cd
4 files changed
+15
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
9 | | - | |
| 9 | + | |
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
15 | 15 | | |
16 | | - | |
| 16 | + | |
17 | 17 | | |
18 | 18 | | |
19 | 19 | | |
| |||
117 | 117 | | |
118 | 118 | | |
119 | 119 | | |
| 120 | + | |
120 | 121 | | |
121 | 122 | | |
122 | 123 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
489 | 489 | | |
490 | 490 | | |
491 | 491 | | |
| 492 | + | |
492 | 493 | | |
493 | 494 | | |
494 | 495 | | |
| |||
1363 | 1364 | | |
1364 | 1365 | | |
1365 | 1366 | | |
| 1367 | + | |
1366 | 1368 | | |
1367 | 1369 | | |
1368 | 1370 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
443 | 443 | | |
444 | 444 | | |
445 | 445 | | |
| 446 | + | |
446 | 447 | | |
447 | 448 | | |
448 | 449 | | |
| |||
535 | 536 | | |
536 | 537 | | |
537 | 538 | | |
| 539 | + | |
538 | 540 | | |
539 | 541 | | |
540 | 542 | | |
| |||
648 | 650 | | |
649 | 651 | | |
650 | 652 | | |
| 653 | + | |
651 | 654 | | |
652 | 655 | | |
653 | 656 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1447 | 1447 | | |
1448 | 1448 | | |
1449 | 1449 | | |
| 1450 | + | |
1450 | 1451 | | |
1451 | 1452 | | |
1452 | 1453 | | |
| |||
1459 | 1460 | | |
1460 | 1461 | | |
1461 | 1462 | | |
| 1463 | + | |
1462 | 1464 | | |
1463 | 1465 | | |
1464 | 1466 | | |
| 1467 | + | |
1465 | 1468 | | |
1466 | 1469 | | |
1467 | 1470 | | |
| |||
2132 | 2135 | | |
2133 | 2136 | | |
2134 | 2137 | | |
| 2138 | + | |
2135 | 2139 | | |
2136 | 2140 | | |
2137 | 2141 | | |
| |||
2222 | 2226 | | |
2223 | 2227 | | |
2224 | 2228 | | |
| 2229 | + | |
2225 | 2230 | | |
2226 | 2231 | | |
2227 | 2232 | | |
| |||
2236 | 2241 | | |
2237 | 2242 | | |
2238 | 2243 | | |
| 2244 | + | |
2239 | 2245 | | |
2240 | 2246 | | |
2241 | 2247 | | |
| |||
2262 | 2268 | | |
2263 | 2269 | | |
2264 | 2270 | | |
| 2271 | + | |
2265 | 2272 | | |
2266 | 2273 | | |
2267 | 2274 | | |
| |||
0 commit comments