tests/cfg: allow unused extern crates
authorTatsuyuki Ishi <ishitatsuyuki@gmail.com>
Sun, 27 Aug 2017 07:14:15 +0000 (16:14 +0900)
committerTatsuyuki Ishi <ishitatsuyuki@gmail.com>
Sun, 27 Aug 2017 07:14:15 +0000 (16:14 +0900)
tests/cfg.rs

index 0e7bbb61763280b36be8cb57d3e38dbb872da821..e1af62158761719b05448ddd711c5d77abe66df2 100644 (file)
@@ -208,7 +208,7 @@ fn works_through_the_registry() {
             [dependencies]
             bar = "0.1.0"
         "#)
-        .file("src/lib.rs", "extern crate bar;");
+        .file("src/lib.rs", "#[allow(unused_extern_crates)] extern crate bar;");
 
     assert_that(p.cargo_process("build"),
                 execs().with_status(0).with_stderr("\
@@ -242,7 +242,7 @@ fn ignore_version_from_other_platform() {
             [target.'cfg({})'.dependencies]
             foo = "0.2.0"
         "#, this_family, other_family))
-        .file("src/lib.rs", "extern crate foo;");
+        .file("src/lib.rs", "#[allow(unused_extern_crates)] extern crate foo;");
 
     assert_that(p.cargo_process("build"),
                 execs().with_status(0).with_stderr("\