]> git.lizzy.rs Git - rust.git/commitdiff
test: Fix tests for crate_id removal
authorAlex Crichton <alex@alexcrichton.com>
Tue, 1 Jul 2014 18:51:41 +0000 (11:51 -0700)
committerAlex Crichton <alex@alexcrichton.com>
Sat, 5 Jul 2014 19:46:42 +0000 (12:46 -0700)
This involved removing some tests whose functionality was removed such as many
of the crateresolve tests

52 files changed:
src/test/auxiliary/crateresolve1-1.rs
src/test/auxiliary/crateresolve1-2.rs
src/test/auxiliary/crateresolve1-3.rs
src/test/auxiliary/crateresolve2-1.rs [deleted file]
src/test/auxiliary/crateresolve2-2.rs [deleted file]
src/test/auxiliary/crateresolve2-3.rs [deleted file]
src/test/auxiliary/extern-crosscrate-source.rs
src/test/auxiliary/issue-11908-1.rs [deleted file]
src/test/auxiliary/issue-11908-2.rs [deleted file]
src/test/compile-fail/bad-crate-id.rs
src/test/compile-fail/bad-crate-id2.rs [new file with mode: 0644]
src/test/compile-fail/crateresolve2.rs [deleted file]
src/test/compile-fail/crateresolve5.rs [deleted file]
src/test/compile-fail/issue-11908-1.rs [deleted file]
src/test/compile-fail/issue-11908-2.rs [deleted file]
src/test/compile-fail/use-meta.rc [deleted file]
src/test/run-make/bootstrap-from-c-with-green/Makefile
src/test/run-make/bootstrap-from-c-with-green/lib.rs
src/test/run-make/bootstrap-from-c-with-native/Makefile
src/test/run-make/c-link-to-rust-dylib/Makefile
src/test/run-make/c-link-to-rust-staticlib/Makefile
src/test/run-make/crate-data-smoke/Makefile
src/test/run-make/crate-data-smoke/crate.rs
src/test/run-make/crate-data-smoke/lib.rs
src/test/run-make/crate-data-smoke/rlib.rs
src/test/run-make/dep-info/lib.rs
src/test/run-make/extern-flag-disambiguates/a.rs
src/test/run-make/extern-flag-disambiguates/b.rs
src/test/run-make/extern-flag-disambiguates/c.rs
src/test/run-make/extern-flag-disambiguates/d.rs
src/test/run-make/extern-flag-fun/bar.rs
src/test/run-make/extern-flag-fun/foo.rs
src/test/run-make/issue-11908/Makefile [new file with mode: 0644]
src/test/run-make/issue-11908/bar.rs [new file with mode: 0644]
src/test/run-make/issue-11908/foo.rs [new file with mode: 0644]
src/test/run-make/lto-smoke-c/Makefile
src/test/run-make/lto-syntax-extension/lib.rs
src/test/run-make/metadata-flag-frobs-symbols/bar.rs
src/test/run-make/metadata-flag-frobs-symbols/foo.rs
src/test/run-make/multiple-versions/Makefile [new file with mode: 0644]
src/test/run-make/multiple-versions/bar.rs [new file with mode: 0644]
src/test/run-make/multiple-versions/foo.rs [new file with mode: 0644]
src/test/run-make/output-type-permutations/foo.rs
src/test/run-make/weird-output-filenames/Makefile
src/test/run-pass/crateresolve1.rs [deleted file]
src/test/run-pass/crateresolve2.rs [deleted file]
src/test/run-pass/crateresolve3.rs [deleted file]
src/test/run-pass/crateresolve4.rs [deleted file]
src/test/run-pass/crateresolve5.rs [deleted file]
src/test/run-pass/crateresolve8.rs [deleted file]
src/test/run-pass/extern-crosscrate.rs
src/test/run-pass/use.rs

index eddedfa36bb301657b77b5b91a4a6a9053eaeead..e26ea7c4fa6d0b73b79e49c83722512ccd5549fa 100644 (file)
@@ -8,8 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
-#![crate_id="crateresolve1#0.1"]
-
+// compile-flags:-C extra-filename=-1
+#![crate_name = "crateresolve1"]
 #![crate_type = "lib"]
 
 pub fn f() -> int { 10 }
index 48042de0bad45830c9bad3e554e266c09c990fbf..715171b143a4a46686e59ad3ab168f2a52a6a272 100644 (file)
@@ -8,8 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
-#![crate_id="crateresolve1#0.2"]
-
+// compile-flags:-C extra-filename=-2
+#![crate_name = "crateresolve1"]
 #![crate_type = "lib"]
 
 pub fn f() -> int { 20 }
index c126560fe3eb2cbec9ffbe01433625ecaa4afa40..f733b5b908ab49aff407753905edf2a33317e185 100644 (file)
@@ -8,8 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
-#![crate_id="crateresolve1#0.3"]
-
+// compile-flags:-C extra-filename=-3
+#![crate_name = "crateresolve1"]
 #![crate_type = "lib"]
 
 pub fn f() -> int { 30 }
diff --git a/src/test/auxiliary/crateresolve2-1.rs b/src/test/auxiliary/crateresolve2-1.rs
deleted file mode 100644 (file)
index f436e7c..0000000
+++ /dev/null
@@ -1,15 +0,0 @@
-// Copyright 2012 The Rust Project Developers. See the COPYRIGHT
-// file at the top-level directory of this distribution and at
-// http://rust-lang.org/COPYRIGHT.
-//
-// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
-// option. This file may not be copied, modified, or distributed
-// except according to those terms.
-
-#![crate_id="crateresolve2#0.1"]
-
-#![crate_type = "lib"]
-
-pub fn f() -> int { 10 }
diff --git a/src/test/auxiliary/crateresolve2-2.rs b/src/test/auxiliary/crateresolve2-2.rs
deleted file mode 100644 (file)
index 1f92ce5..0000000
+++ /dev/null
@@ -1,15 +0,0 @@
-// Copyright 2012 The Rust Project Developers. See the COPYRIGHT
-// file at the top-level directory of this distribution and at
-// http://rust-lang.org/COPYRIGHT.
-//
-// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
-// option. This file may not be copied, modified, or distributed
-// except according to those terms.
-
-#![crate_id="crateresolve2#0.2"]
-
-#![crate_type = "lib"]
-
-pub fn f() -> int { 20 }
diff --git a/src/test/auxiliary/crateresolve2-3.rs b/src/test/auxiliary/crateresolve2-3.rs
deleted file mode 100644 (file)
index fe064b7..0000000
+++ /dev/null
@@ -1,15 +0,0 @@
-// Copyright 2012 The Rust Project Developers. See the COPYRIGHT
-// file at the top-level directory of this distribution and at
-// http://rust-lang.org/COPYRIGHT.
-//
-// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
-// option. This file may not be copied, modified, or distributed
-// except according to those terms.
-
-#![crate_id="crateresolve2#0.3"]
-
-#![crate_type = "lib"]
-
-pub fn f() -> int { 30 }
index e26f8effb47fc85f852d1d878a7a8d7c0875d0d4..5c83b327912270e6a15c9a7f6b89e154df86a19a 100644 (file)
@@ -8,7 +8,7 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
-#![crate_id="externcallback#0.1"]
+#![crate_name="externcallback"]
 #![crate_type = "lib"]
 
 extern crate libc;
diff --git a/src/test/auxiliary/issue-11908-1.rs b/src/test/auxiliary/issue-11908-1.rs
deleted file mode 100644 (file)
index 8a48e48..0000000
+++ /dev/null
@@ -1,14 +0,0 @@
-// Copyright 2014 The Rust Project Developers. See the COPYRIGHT
-// file at the top-level directory of this distribution and at
-// http://rust-lang.org/COPYRIGHT.
-//
-// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
-// option. This file may not be copied, modified, or distributed
-// except according to those terms.
-
-// no-prefer-dynamic
-
-#![crate_id = "url#0.11.0"]
-#![crate_type = "dylib"]
diff --git a/src/test/auxiliary/issue-11908-2.rs b/src/test/auxiliary/issue-11908-2.rs
deleted file mode 100644 (file)
index 0deece5..0000000
+++ /dev/null
@@ -1,14 +0,0 @@
-// Copyright 2014 The Rust Project Developers. See the COPYRIGHT
-// file at the top-level directory of this distribution and at
-// http://rust-lang.org/COPYRIGHT.
-//
-// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
-// option. This file may not be copied, modified, or distributed
-// except according to those terms.
-
-// no-prefer-dynamic
-
-#![crate_id = "url#0.11.0"]
-#![crate_type = "rlib"]
index 43956752cd9b343fc72ee2f8f375ceab67815498..883bfd035f40abbcba04a8c212b8e4ecdb2890b1 100644 (file)
@@ -8,7 +8,6 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
-extern crate foo = ""; //~ ERROR: malformed crate id
-extern crate bar = "#a"; //~ ERROR: malformed crate id
+extern crate foo = ""; //~ ERROR: crate name must not be empty
 
 fn main() {}
diff --git a/src/test/compile-fail/bad-crate-id2.rs b/src/test/compile-fail/bad-crate-id2.rs
new file mode 100644 (file)
index 0000000..fcbdc6d
--- /dev/null
@@ -0,0 +1,14 @@
+// Copyright 2014 The Rust Project Developers. See the COPYRIGHT
+// file at the top-level directory of this distribution and at
+// http://rust-lang.org/COPYRIGHT.
+//
+// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
+// option. This file may not be copied, modified, or distributed
+// except according to those terms.
+
+extern crate bar = "#a"; //~ ERROR: invalid character in crate name: `#`
+
+fn main() {}
+
diff --git a/src/test/compile-fail/crateresolve2.rs b/src/test/compile-fail/crateresolve2.rs
deleted file mode 100644 (file)
index c5e9d12..0000000
+++ /dev/null
@@ -1,24 +0,0 @@
-// Copyright 2012 The Rust Project Developers. See the COPYRIGHT
-// file at the top-level directory of this distribution and at
-// http://rust-lang.org/COPYRIGHT.
-//
-// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
-// option. This file may not be copied, modified, or distributed
-// except according to those terms.
-
-// aux-build:crateresolve2-1.rs
-// aux-build:crateresolve2-2.rs
-// aux-build:crateresolve2-3.rs
-// error-pattern:using multiple versions of crate `crateresolve2`
-
-extern crate crateresolve2 = "crateresolve2#0.1";
-
-mod m {
-    pub extern crate crateresolve2 = "crateresolve2#0.2";
-}
-
-fn main() {
-    let x: int = false;
-}
diff --git a/src/test/compile-fail/crateresolve5.rs b/src/test/compile-fail/crateresolve5.rs
deleted file mode 100644 (file)
index 8b48014..0000000
+++ /dev/null
@@ -1,21 +0,0 @@
-// Copyright 2012-2014 The Rust Project Developers. See the COPYRIGHT
-// file at the top-level directory of this distribution and at
-// http://rust-lang.org/COPYRIGHT.
-//
-// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
-// option. This file may not be copied, modified, or distributed
-// except according to those terms.
-
-// aux-build:crateresolve5-1.rs
-// aux-build:crateresolve5-2.rs
-
-extern crate cr5_1 = "crateresolve5#0.1";
-extern crate cr5_2 = "crateresolve5#0.2";
-
-
-fn main() {
-    // Nominal types from two multiple versions of a crate are different types
-    assert!(cr5_1::nominal() == cr5_2::nominal()); //~ ERROR mismatched types: expected
-}
diff --git a/src/test/compile-fail/issue-11908-1.rs b/src/test/compile-fail/issue-11908-1.rs
deleted file mode 100644 (file)
index dbedf35..0000000
+++ /dev/null
@@ -1,24 +0,0 @@
-// Copyright 2014 The Rust Project Developers. See the COPYRIGHT
-// file at the top-level directory of this distribution and at
-// http://rust-lang.org/COPYRIGHT.
-//
-// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
-// option. This file may not be copied, modified, or distributed
-// except according to those terms.
-
-// aux-build:issue-11908-1.rs
-// ignore-android this test is incompatible with the android test runner
-// error-pattern: multiple dylib candidates for `url` found
-
-// This test ensures that if you have the same rlib or dylib at two locations
-// in the same path that you don't hit an assertion in the compiler.
-//
-// Note that this relies on `liburl` to be in the path somewhere else,
-// and then our aux-built libraries will collide with liburl (they have
-// the same version listed)
-
-extern crate url;
-
-fn main() {}
diff --git a/src/test/compile-fail/issue-11908-2.rs b/src/test/compile-fail/issue-11908-2.rs
deleted file mode 100644 (file)
index 8b916aa..0000000
+++ /dev/null
@@ -1,21 +0,0 @@
-// Copyright 2014 The Rust Project Developers. See the COPYRIGHT
-// file at the top-level directory of this distribution and at
-// http://rust-lang.org/COPYRIGHT.
-//
-// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
-// option. This file may not be copied, modified, or distributed
-// except according to those terms.
-
-// aux-build:issue-11908-2.rs
-// no-prefer-dynamic
-// ignore-android this test is incompatible with the android test runner
-// error-pattern: multiple rlib candidates for `url` found
-
-// see comments in issue-11908-1 for what's going on here
-
-extern crate url;
-
-fn main() {}
-
diff --git a/src/test/compile-fail/use-meta.rc b/src/test/compile-fail/use-meta.rc
deleted file mode 100644 (file)
index 9cb84c5..0000000
+++ /dev/null
@@ -1,13 +0,0 @@
-// Copyright 2012 The Rust Project Developers. See the COPYRIGHT
-// file at the top-level directory of this distribution and at
-// http://rust-lang.org/COPYRIGHT.
-//
-// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
-// option. This file may not be copied, modified, or distributed
-// except according to those terms.
-
-// error-pattern:can't find crate for `std`
-
-extern crate std = "std#bogus";
index 3b28af9b0e83f09c4db60be429cc14b171290f2d..c7753a67464ac64ad0e9b8193c8996632a076f41 100644 (file)
@@ -6,7 +6,6 @@ TARGET_RPATH_DIR:=$(TARGET_RPATH_DIR):$(TMPDIR)
 
 all:
        $(RUSTC) lib.rs
-       ln -nsf $(call DYLIB,boot-*) $(call DYLIB,boot)
        $(CC) main.c -o $(call RUN_BINFILE,main) $(call RPATH_LINK_SEARCH,$(HOST_LIB_DIR)) -lboot
        $(call RUN,main)
        $(call REMOVE_DYLIBS,boot)
index 69c65ef8b037a2869ee00682bf449942c742565d..7f17018c486c0e11ef543dc54e8fa4fa69bff0c9 100644 (file)
@@ -8,7 +8,7 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
-#![crate_id="boot#0.1"]
+#![crate_name="boot"]
 #![crate_type="dylib"]
 
 extern crate rustuv;
index 3b28af9b0e83f09c4db60be429cc14b171290f2d..c7753a67464ac64ad0e9b8193c8996632a076f41 100644 (file)
@@ -6,7 +6,6 @@ TARGET_RPATH_DIR:=$(TARGET_RPATH_DIR):$(TMPDIR)
 
 all:
        $(RUSTC) lib.rs
-       ln -nsf $(call DYLIB,boot-*) $(call DYLIB,boot)
        $(CC) main.c -o $(call RUN_BINFILE,main) $(call RPATH_LINK_SEARCH,$(HOST_LIB_DIR)) -lboot
        $(call RUN,main)
        $(call REMOVE_DYLIBS,boot)
index e743004a9cbc6caf86e4a8ba6395674954f9fc2d..a5b4430ab6a0c30d4a64da45bb359b77e4f65997 100644 (file)
@@ -4,7 +4,6 @@ HOST_LIB_DIR=$(TMPDIR)/../../../stage$(RUST_BUILD_STAGE)/lib
 
 all:
        $(RUSTC) foo.rs
-       ln -s $(call DYLIB,foo-*) $(call DYLIB,foo)
        $(CC) bar.c -lfoo -o $(call RUN_BINFILE,bar) $(call RPATH_LINK_SEARCH,$(HOST_LIB_DIR)) -Wl,-rpath,$(TMPDIR)
        $(call RUN,bar)
        $(call REMOVE_DYLIBS,foo)
index 40b6feac678233f1154f768c1112215bae4a4f94..8a6d6e4dd6d786122f2a338232d128c33cb32532 100644 (file)
@@ -10,7 +10,6 @@ endif
 ifneq ($(shell uname),FreeBSD)
 all:
        $(RUSTC) foo.rs
-       ln -s $(call STATICLIB,foo-*) $(call STATICLIB,foo)
        $(CC) bar.c -lfoo -o $(call RUN_BINFILE,bar) $(EXTRAFLAGS) -lstdc++
        $(call RUN,bar)
        rm $(call STATICLIB,foo*)
index a44481b4b7f23d75f339fa247fe7729c05d8db14..a709320c0f910595d6a589763b89acfd9a4d6647 100644 (file)
@@ -1,7 +1,6 @@
 -include ../tools.mk
 
 all:
-       [ `$(RUSTC) --crate-id crate.rs` = "foo#0.11.0" ]
        [ `$(RUSTC) --crate-name crate.rs` = "foo" ]
        [ `$(RUSTC) --crate-file-name crate.rs` = "foo" ]
        [ `$(RUSTC) --crate-file-name --crate-type=lib --test crate.rs` = "foo" ]
index 9faa7c016284bf054eec1849d20b436bb524263a..305b3dc70a625006de0c6f3a198e046bcf6a1ff0 100644 (file)
@@ -8,7 +8,7 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
-#![crate_id = "foo#0.11.0"]
+#![crate_name = "foo"]
 
 // Querying about the crate metadata should *not* parse the entire crate, it
 // only needs the crate attributes (which are guaranteed to be at the top) be
index b40e055b3cba91642646a3aef6228df1e60fef48..639a5d0387b8ea045146515086885abdd0c89e4e 100644 (file)
@@ -8,5 +8,5 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
-#![crate_id = "mylib"]
+#![crate_name = "mylib"]
 #![crate_type = "lib"]
index 94b8371e5375790d2bf63bcee91e4db536506e08..4e0937486003c19db4449023356883814c211b55 100644 (file)
@@ -8,5 +8,5 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
-#![crate_id = "mylib"]
+#![crate_name = "mylib"]
 #![crate_type = "rlib"]
index 4255b1d934d9c668edd49fa6a75944fc5c09d85d..7c15785bbb23d61eaa2a5e6315852dd2e9c2de25 100644 (file)
@@ -8,7 +8,7 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
-#![crate_id="foo#0.1"]
+#![crate_name = "foo"]
 
 pub mod foo;
 pub mod bar;
index db1a0e0433ece380ce0e1f4e81a714d6e6f370db..11b9ba6fce3383fd5e2162076b56854feeba83a6 100644 (file)
@@ -1,3 +1,13 @@
+// Copyright 2014 The Rust Project Developers. See the COPYRIGHT
+// file at the top-level directory of this distribution and at
+// http://rust-lang.org/COPYRIGHT.
+//
+// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
+// option. This file may not be copied, modified, or distributed
+// except according to those terms.
+
 #![crate_name = "a"]
 #![crate_type = "rlib"]
 
index f4fb09631a9c7690be8231a6f3fe4bfc27924858..3156cf0ba7275a0f99ee4d1f0b0625f89c7624ea 100644 (file)
@@ -1,3 +1,13 @@
+// Copyright 2014 The Rust Project Developers. See the COPYRIGHT
+// file at the top-level directory of this distribution and at
+// http://rust-lang.org/COPYRIGHT.
+//
+// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
+// option. This file may not be copied, modified, or distributed
+// except according to those terms.
+
 #![crate_name = "b"]
 #![crate_type = "rlib"]
 
index e017d747e6fe4ff248d30ab81bc76d3840d7034f..d3bbc762ef2f360e464ac5506e5b12e1c642e2be 100644 (file)
@@ -1,3 +1,13 @@
+// Copyright 2014 The Rust Project Developers. See the COPYRIGHT
+// file at the top-level directory of this distribution and at
+// http://rust-lang.org/COPYRIGHT.
+//
+// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
+// option. This file may not be copied, modified, or distributed
+// except according to those terms.
+
 #![crate_name = "c"]
 #![crate_type = "rlib"]
 
index e3c968edb6a9fcb3cd026eeba502dfbbe679eaf4..d850daffc39414ce661b238d61f32eb1fa907d3f 100644 (file)
@@ -1,3 +1,13 @@
+// Copyright 2014 The Rust Project Developers. See the COPYRIGHT
+// file at the top-level directory of this distribution and at
+// http://rust-lang.org/COPYRIGHT.
+//
+// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
+// option. This file may not be copied, modified, or distributed
+// except according to those terms.
+
 #[cfg(before)] extern crate a;
 extern crate b;
 extern crate c;
index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..2152aa79c3370a337ef242c64a9f04c09d45d8f3 100644 (file)
@@ -0,0 +1,10 @@
+// Copyright 2014 The Rust Project Developers. See the COPYRIGHT
+// file at the top-level directory of this distribution and at
+// http://rust-lang.org/COPYRIGHT.
+//
+// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
+// option. This file may not be copied, modified, or distributed
+// except according to those terms.
+
index 0edda7d7b8842debbdd5417ed08d904c00d9c956..52741668640112e4d2dc33bca3c1de4e0043ca38 100644 (file)
@@ -1,3 +1,13 @@
+// Copyright 2014 The Rust Project Developers. See the COPYRIGHT
+// file at the top-level directory of this distribution and at
+// http://rust-lang.org/COPYRIGHT.
+//
+// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
+// option. This file may not be copied, modified, or distributed
+// except according to those terms.
+
 extern crate bar;
 
 fn main() {}
diff --git a/src/test/run-make/issue-11908/Makefile b/src/test/run-make/issue-11908/Makefile
new file mode 100644 (file)
index 0000000..66f360d
--- /dev/null
@@ -0,0 +1,21 @@
+# This test ensures that if you have the same rlib or dylib at two locations
+# in the same path that you don't hit an assertion in the compiler.
+#
+# Note that this relies on `liburl` to be in the path somewhere else,
+# and then our aux-built libraries will collide with liburl (they have
+# the same version listed)
+
+-include ../tools.mk
+
+all:
+       mkdir $(TMPDIR)/other
+       $(RUSTC) foo.rs --crate-type=dylib
+       $(RUSTC) foo.rs --crate-type=dylib -o $(TMPDIR)/other/libfoo.so
+       $(RUSTC) bar.rs -L $(TMPDIR)/other 2>&1 | \
+               grep "multiple dylib candidates"
+       rm -rf $(TMPDIR)
+       mkdir -p $(TMPDIR)/other
+       $(RUSTC) foo.rs --crate-type=rlib
+       $(RUSTC) foo.rs --crate-type=rlib -o $(TMPDIR)/other/libfoo.rlib
+       $(RUSTC) bar.rs -L $(TMPDIR)/other 2>&1 | \
+               grep "multiple rlib candidates"
diff --git a/src/test/run-make/issue-11908/bar.rs b/src/test/run-make/issue-11908/bar.rs
new file mode 100644 (file)
index 0000000..6316cfa
--- /dev/null
@@ -0,0 +1,13 @@
+// Copyright 2014 The Rust Project Developers. See the COPYRIGHT
+// file at the top-level directory of this distribution and at
+// http://rust-lang.org/COPYRIGHT.
+//
+// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
+// option. This file may not be copied, modified, or distributed
+// except according to those terms.
+
+extern crate foo;
+
+fn main() {}
diff --git a/src/test/run-make/issue-11908/foo.rs b/src/test/run-make/issue-11908/foo.rs
new file mode 100644 (file)
index 0000000..0858d3c
--- /dev/null
@@ -0,0 +1,11 @@
+// Copyright 2014 The Rust Project Developers. See the COPYRIGHT
+// file at the top-level directory of this distribution and at
+// http://rust-lang.org/COPYRIGHT.
+//
+// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
+// option. This file may not be copied, modified, or distributed
+// except according to those terms.
+
+#![crate_name = "foo"]
index 9b44c3e582a71da13db68407fedadaaf5435796c..6c7e9aa1d59fda347da1af71ffe94d2dcb5f1e21 100644 (file)
@@ -5,6 +5,5 @@ CC := $(CC:-g=)
 
 all:
        $(RUSTC) foo.rs -Z lto
-       ln -s $(call STATICLIB,foo-*) $(call STATICLIB,foo)
        $(CC) bar.c -lfoo -o $(call RUN_BINFILE,bar) $(EXTRACFLAGS) -lstdc++
        $(call RUN,bar)
index fbe967786e25ecb61c99a398e60a81ef37134689..04d3ae67207228d9bfe4d16f9873b5cd8bbe3f92 100644 (file)
@@ -8,4 +8,4 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
-#[crate_type = "rlib"];
+#![crate_type = "rlib"]
index 1e6957a3694b60bd0b86bced1d9867e7d4fc4754..44b9e2f874a4bf2610f7ec4ed8b97d975f198c38 100644 (file)
@@ -1,3 +1,13 @@
+// Copyright 2014 The Rust Project Developers. See the COPYRIGHT
+// file at the top-level directory of this distribution and at
+// http://rust-lang.org/COPYRIGHT.
+//
+// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
+// option. This file may not be copied, modified, or distributed
+// except according to those terms.
+
 extern crate foo1;
 extern crate foo2;
 
index 1974f4bc56284dcefe47dae90800862b88a712b3..ed04eed8cf77e602f57358e674da214027fcc84e 100644 (file)
@@ -1,3 +1,13 @@
+// Copyright 2014 The Rust Project Developers. See the COPYRIGHT
+// file at the top-level directory of this distribution and at
+// http://rust-lang.org/COPYRIGHT.
+//
+// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
+// option. This file may not be copied, modified, or distributed
+// except according to those terms.
+
 #![crate_name = "foo"]
 #![crate_type = "rlib"]
 
diff --git a/src/test/run-make/multiple-versions/Makefile b/src/test/run-make/multiple-versions/Makefile
new file mode 100644 (file)
index 0000000..e60c16a
--- /dev/null
@@ -0,0 +1,9 @@
+-include ../tools.mk
+
+all:
+       $(RUSTC) foo.rs -C metadata=a -C extra-filename=-1 --crate-type=rlib
+       $(RUSTC) foo.rs -C metadata=b -C extra-filename=-2 --crate-type=rlib
+       $(RUSTC) bar.rs \
+               --extern foo1=$(TMPDIR)/libfoo-1.rlib \
+               --extern foo2=$(TMPDIR)/libfoo-2.rlib \
+               2>&1 | grep "using multiple versions of crate .foo."
diff --git a/src/test/run-make/multiple-versions/bar.rs b/src/test/run-make/multiple-versions/bar.rs
new file mode 100644 (file)
index 0000000..262193a
--- /dev/null
@@ -0,0 +1,14 @@
+// Copyright 2014 The Rust Project Developers. See the COPYRIGHT
+// file at the top-level directory of this distribution and at
+// http://rust-lang.org/COPYRIGHT.
+//
+// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
+// option. This file may not be copied, modified, or distributed
+// except according to those terms.
+
+extern crate foo1;
+extern crate foo2;
+
+fn main() {}
diff --git a/src/test/run-make/multiple-versions/foo.rs b/src/test/run-make/multiple-versions/foo.rs
new file mode 100644 (file)
index 0000000..2661b1f
--- /dev/null
@@ -0,0 +1,11 @@
+// Copyright 2014 The Rust Project Developers. See the COPYRIGHT
+// file at the top-level directory of this distribution and at
+// http://rust-lang.org/COPYRIGHT.
+//
+// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
+// option. This file may not be copied, modified, or distributed
+// except according to those terms.
+
+pub fn foo() {}
index 020fbc3299b6831db6acecb421d34bc2c9706c9c..bb5796bd8737ff3c01d46d8aa588766c672a62ab 100644 (file)
@@ -8,6 +8,6 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
-#![crate_id = "bar"]
+#![crate_name = "bar"]
 
 fn main() {}
index debd89d9929b75784bf89d99ae547e876acca937..37dcf9a6c4a1bf361105c40f1184eb019fa17209 100644 (file)
@@ -1,9 +1,9 @@
 -include ../tools.mk
 
 all:
-       $(RUSTC) foo.rs -o $(TMPDIR)/.foo
-       rm $(TMPDIR)/.foo
-       $(RUSTC) foo.rs -o $(TMPDIR)/.foo.bar
-       rm $(TMPDIR)/.foo.bar
-       $(RUSTC) foo.rs -o $(TMPDIR)/+foo+bar
-       rm $(TMPDIR)/$(call BIN,+foo+bar)
+       $(RUSTC) foo.rs -o $(TMPDIR)/.foo 2>&1 \
+               | grep "invalid character in crate name:"
+       $(RUSTC) foo.rs -o $(TMPDIR)/.foo.bar 2>&1 \
+               | grep "invalid character in crate name:"
+       $(RUSTC) foo.rs -o $(TMPDIR)/+foo+bar 2>&1 \
+               | grep "invalid character in crate name:"
diff --git a/src/test/run-pass/crateresolve1.rs b/src/test/run-pass/crateresolve1.rs
deleted file mode 100644 (file)
index 61e269b..0000000
+++ /dev/null
@@ -1,19 +0,0 @@
-// Copyright 2012-2014 The Rust Project Developers. See the COPYRIGHT
-// file at the top-level directory of this distribution and at
-// http://rust-lang.org/COPYRIGHT.
-//
-// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
-// option. This file may not be copied, modified, or distributed
-// except according to those terms.
-
-// aux-build:crateresolve1-1.rs
-// aux-build:crateresolve1-2.rs
-// aux-build:crateresolve1-3.rs
-
-extern crate crateresolve1 = "crateresolve1#0.2";
-
-pub fn main() {
-    assert_eq!(crateresolve1::f(), 20);
-}
diff --git a/src/test/run-pass/crateresolve2.rs b/src/test/run-pass/crateresolve2.rs
deleted file mode 100644 (file)
index 5ed1f37..0000000
+++ /dev/null
@@ -1,34 +0,0 @@
-// Copyright 2012-2014 The Rust Project Developers. See the COPYRIGHT
-// file at the top-level directory of this distribution and at
-// http://rust-lang.org/COPYRIGHT.
-//
-// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
-// option. This file may not be copied, modified, or distributed
-// except according to those terms.
-
-// aux-build:crateresolve2-1.rs
-// aux-build:crateresolve2-2.rs
-// aux-build:crateresolve2-3.rs
-
-mod a {
-    extern crate crateresolve2 = "crateresolve2#0.1";
-    pub fn f() { assert!(crateresolve2::f() == 10); }
-}
-
-mod b {
-    extern crate crateresolve2 = "crateresolve2#0.2";
-    pub fn f() { assert!(crateresolve2::f() == 20); }
-}
-
-mod c {
-    extern crate crateresolve2 = "crateresolve2#0.3";
-    pub fn f() { assert!(crateresolve2::f() == 30); }
-}
-
-pub fn main() {
-    a::f();
-    b::f();
-    c::f();
-}
diff --git a/src/test/run-pass/crateresolve3.rs b/src/test/run-pass/crateresolve3.rs
deleted file mode 100644 (file)
index cee9e69..0000000
+++ /dev/null
@@ -1,30 +0,0 @@
-// Copyright 2012-2014 The Rust Project Developers. See the COPYRIGHT
-// file at the top-level directory of this distribution and at
-// http://rust-lang.org/COPYRIGHT.
-//
-// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
-// option. This file may not be copied, modified, or distributed
-// except according to those terms.
-
-// aux-build:crateresolve3-1.rs
-// aux-build:crateresolve3-2.rs
-
-// verify able to link with crates with same name but different versions
-// as long as no name collision on invoked functions.
-
-mod a {
-    extern crate crateresolve3 = "crateresolve3#0.1";
-    pub fn f() { assert!(crateresolve3::f() == 10); }
-}
-
-mod b {
-    extern crate crateresolve3 = "crateresolve3#0.2";
-    pub fn f() { assert!(crateresolve3::g() == 20); }
-}
-
-pub fn main() {
-    a::f();
-    b::f();
-}
diff --git a/src/test/run-pass/crateresolve4.rs b/src/test/run-pass/crateresolve4.rs
deleted file mode 100644 (file)
index c689615..0000000
+++ /dev/null
@@ -1,29 +0,0 @@
-// Copyright 2012-2014 The Rust Project Developers. See the COPYRIGHT
-// file at the top-level directory of this distribution and at
-// http://rust-lang.org/COPYRIGHT.
-//
-// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
-// option. This file may not be copied, modified, or distributed
-// except according to those terms.
-
-// aux-build:crateresolve4a-1.rs
-// aux-build:crateresolve4a-2.rs
-// aux-build:crateresolve4b-1.rs
-// aux-build:crateresolve4b-2.rs
-
-pub mod a {
-    extern crate crateresolve4b = "crateresolve4b#0.1";
-    pub fn f() { assert!(crateresolve4b::f() == 20); }
-}
-
-pub mod b {
-    extern crate crateresolve4b = "crateresolve4b#0.2";
-    pub fn f() { assert!(crateresolve4b::g() == 10); }
-}
-
-pub fn main() {
-    a::f();
-    b::f();
-}
diff --git a/src/test/run-pass/crateresolve5.rs b/src/test/run-pass/crateresolve5.rs
deleted file mode 100644 (file)
index 3f74731..0000000
+++ /dev/null
@@ -1,23 +0,0 @@
-// Copyright 2012-2014 The Rust Project Developers. See the COPYRIGHT
-// file at the top-level directory of this distribution and at
-// http://rust-lang.org/COPYRIGHT.
-//
-// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
-// option. This file may not be copied, modified, or distributed
-// except according to those terms.
-
-// aux-build:crateresolve5-1.rs
-// aux-build:crateresolve5-2.rs
-
-extern crate cr5_1 = "crateresolve5#0.1";
-extern crate cr5_2 = "crateresolve5#0.2";
-
-pub fn main() {
-    // Structural types can be used between two versions of the same crate
-    assert!(cr5_1::struct_nameval().name == cr5_2::struct_nameval().name);
-    assert!(cr5_1::struct_nameval().val == cr5_2::struct_nameval().val);
-    // Make sure these are actually two different crates
-    assert!(cr5_1::f() == 10 && cr5_2::f() == 20);
-}
diff --git a/src/test/run-pass/crateresolve8.rs b/src/test/run-pass/crateresolve8.rs
deleted file mode 100644 (file)
index f04e383..0000000
+++ /dev/null
@@ -1,20 +0,0 @@
-// Copyright 2012-2014 The Rust Project Developers. See the COPYRIGHT
-// file at the top-level directory of this distribution and at
-// http://rust-lang.org/COPYRIGHT.
-//
-// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
-// option. This file may not be copied, modified, or distributed
-// except according to those terms.
-
-// aux-build:crateresolve8-1.rs
-
-#![crate_id="crateresolve8#0.1"]
-
-extern crate crateresolve8 = "crateresolve8#0.1";
-//extern crate crateresolve8(vers = "0.1");
-
-pub fn main() {
-    assert_eq!(crateresolve8::f(), 20);
-}
index 3faf5744199862c9ba9533504c25f459fad7c8ec..5dc25c85325c0f20780e82bf4784a91af87da3d1 100644 (file)
@@ -10,7 +10,7 @@
 
 //aux-build:extern-crosscrate-source.rs
 
-extern crate externcallback = "externcallback#0.1";
+extern crate externcallback;
 
 fn fact(n: uint) -> uint {
     unsafe {
index 3f152cc10610f3ae1894c654f09f4d6a9a9f33ed..dfed391640516d0cf6e6b90e4d65d5c0d685b2f7 100644 (file)
 #![no_std]
 extern crate std;
 extern crate zed = "std";
-extern crate bar = "std#0.11.0";
 
 
 use std::str;
 use x = zed::str;
 mod baz {
-    pub use bar::str;
     pub use x = std::str;
 }