about summary refs log tree commit diff
path: root/src/test
diff options
context:
space:
mode:
authorAlex Crichton <alex@alexcrichton.com>2014-04-15 07:47:26 -0700
committerAlex Crichton <alex@alexcrichton.com>2014-04-23 10:04:29 -0700
commitb0d85e30b75fb7a2568dba9a535e8ea8e0291fef (patch)
tree1d308e26346c022717f394716c044d0bf8d690b8 /src/test
parentc62daa6ed3866d8649ec8654a09c57f4078e1fdd (diff)
downloadrust-b0d85e30b75fb7a2568dba9a535e8ea8e0291fef.tar.gz
rust-b0d85e30b75fb7a2568dba9a535e8ea8e0291fef.zip
rustc: Don't die when a crate id can't be inferred
The filestem of the desired output isn't necessarily a valid crate id, and
calling unwrap() will trigger an ICE in rustc. This tries a little harder to
infer a "valid crate id" from a crate, with an eventual fallback to a generic
crate id if alll else fails.

Closes #11107
Diffstat (limited to 'src/test')
-rw-r--r--src/test/run-make/weird-output-filenames/Makefile9
-rw-r--r--src/test/run-make/weird-output-filenames/foo.rs11
2 files changed, 20 insertions, 0 deletions
diff --git a/src/test/run-make/weird-output-filenames/Makefile b/src/test/run-make/weird-output-filenames/Makefile
new file mode 100644
index 00000000000..9d852bce6f6
--- /dev/null
+++ b/src/test/run-make/weird-output-filenames/Makefile
@@ -0,0 +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)/+foo+bar
diff --git a/src/test/run-make/weird-output-filenames/foo.rs b/src/test/run-make/weird-output-filenames/foo.rs
new file mode 100644
index 00000000000..8ae3d072362
--- /dev/null
+++ b/src/test/run-make/weird-output-filenames/foo.rs
@@ -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.
+
+fn main() {}