about summary refs log tree commit diff
path: root/src/test
diff options
context:
space:
mode:
authorMark Rousskov <mark.simulacrum@gmail.com>2018-07-26 09:18:41 -0600
committerGitHub <noreply@github.com>2018-07-26 09:18:41 -0600
commitd1e549c1645dfd6da46119405bfe1bd269f4e37e (patch)
tree012cb94c3ce28bf45f9c5e5ea4886bc52870273f /src/test
parent858adfe21dead8b0b2df16a5fc3ac4e8759a9c4e (diff)
parentf069a57bb1fb4f4aae4e42a6ee75ad277bcf9f7f (diff)
downloadrust-d1e549c1645dfd6da46119405bfe1bd269f4e37e.tar.gz
rust-d1e549c1645dfd6da46119405bfe1bd269f4e37e.zip
Rollup merge of #52723 - alexcrichton:fix-extern-rename-ice, r=estebank
rustc: Register crates under their real names

Whenever we register a crate into the crate store, make sure to use the real
name mentioned in the metadata instead of the name mentioned in the `extern
crate` statement, as the statement can be wrong!

Closes #51796
Diffstat (limited to 'src/test')
-rw-r--r--src/test/run-make-fulldeps/extern-flag-rename-transitive/Makefile7
-rw-r--r--src/test/run-make-fulldeps/extern-flag-rename-transitive/bar.rs13
-rw-r--r--src/test/run-make-fulldeps/extern-flag-rename-transitive/baz.rs14
-rw-r--r--src/test/run-make-fulldeps/extern-flag-rename-transitive/foo.rs11
4 files changed, 45 insertions, 0 deletions
diff --git a/src/test/run-make-fulldeps/extern-flag-rename-transitive/Makefile b/src/test/run-make-fulldeps/extern-flag-rename-transitive/Makefile
new file mode 100644
index 00000000000..4354209a722
--- /dev/null
+++ b/src/test/run-make-fulldeps/extern-flag-rename-transitive/Makefile
@@ -0,0 +1,7 @@
+-include ../tools.mk
+
+all:
+	$(RUSTC) foo.rs
+	$(RUSTC) bar.rs
+	$(RUSTC) baz.rs --extern a=$(TMPDIR)/libfoo.rlib
+
diff --git a/src/test/run-make-fulldeps/extern-flag-rename-transitive/bar.rs b/src/test/run-make-fulldeps/extern-flag-rename-transitive/bar.rs
new file mode 100644
index 00000000000..a14f3ba05b0
--- /dev/null
+++ b/src/test/run-make-fulldeps/extern-flag-rename-transitive/bar.rs
@@ -0,0 +1,13 @@
+// Copyright 2018 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_type = "rlib"]
+
+extern crate foo;
diff --git a/src/test/run-make-fulldeps/extern-flag-rename-transitive/baz.rs b/src/test/run-make-fulldeps/extern-flag-rename-transitive/baz.rs
new file mode 100644
index 00000000000..a96c9f61c66
--- /dev/null
+++ b/src/test/run-make-fulldeps/extern-flag-rename-transitive/baz.rs
@@ -0,0 +1,14 @@
+// Copyright 2018 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_type = "rlib"]
+
+extern crate a;
+extern crate bar;
diff --git a/src/test/run-make-fulldeps/extern-flag-rename-transitive/foo.rs b/src/test/run-make-fulldeps/extern-flag-rename-transitive/foo.rs
new file mode 100644
index 00000000000..b18ce024718
--- /dev/null
+++ b/src/test/run-make-fulldeps/extern-flag-rename-transitive/foo.rs
@@ -0,0 +1,11 @@
+// Copyright 2018 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_type = "rlib"]