Fix tests on nightly
authorAlex Crichton <alex@alexcrichton.com>
Mon, 28 Aug 2017 15:03:42 +0000 (08:03 -0700)
committerCarol (Nichols || Goulding) <carol.nichols@gmail.com>
Tue, 3 Oct 2017 18:21:12 +0000 (14:21 -0400)
tests/cross-compile.rs

index 55ba530a792cff8cc690084a81093fb872c6a016..3225c6cabbef39404f47cdc26ba47287b52617b2 100644 (file)
@@ -529,6 +529,7 @@ fn cross_tests() {
             name = "bar"
         "#)
         .file("src/bin/bar.rs", &format!(r#"
+            #[allow(unused_extern_crates)]
             extern crate foo;
             use std::env;
             fn main() {{
@@ -698,10 +699,12 @@ fn build_script_needed_for_host_and_target() {
         "#)
 
         .file("build.rs", r#"
+            #[allow(unused_extern_crates)]
             extern crate d2;
             fn main() { d2::d2(); }
         "#)
         .file("src/main.rs", "
+            #[allow(unused_extern_crates)]
             extern crate d1;
             fn main() { d1::d1(); }
         ")
@@ -732,6 +735,7 @@ fn build_script_needed_for_host_and_target() {
             path = "../d1"
         "#)
         .file("d2/src/lib.rs", "
+            #[allow(unused_extern_crates)]
             extern crate d1;
             pub fn d2() { d1::d1(); }
         ");
@@ -893,7 +897,11 @@ fn build_script_with_platform_specific_dependencies() {
             [build-dependencies.d1]
             path = "d1"
         "#)
-        .file("build.rs", "extern crate d1; fn main() {}")
+        .file("build.rs", "
+            #[allow(unused_extern_crates)]
+            extern crate d1;
+            fn main() {}
+        ")
         .file("src/lib.rs", "")
         .file("d1/Cargo.toml", &format!(r#"
             [package]
@@ -904,7 +912,10 @@ fn build_script_with_platform_specific_dependencies() {
             [target.{}.dependencies]
             d2 = {{ path = "../d2" }}
         "#, host))
-        .file("d1/src/lib.rs", "extern crate d2;")
+        .file("d1/src/lib.rs", "
+            #[allow(unused_extern_crates)]
+            extern crate d2;
+        ")
         .file("d2/Cargo.toml", r#"
             [package]
             name = "d2"