about summary refs log tree commit diff
path: root/src/test/incremental
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2017-05-11 07:06:58 +0000
committerbors <bors@rust-lang.org>2017-05-11 07:06:58 +0000
commit24ea08e9b7c206ee7a0de76b68072e46fc230cbd (patch)
tree7e4e18e89b5d5b33a9a0c162d5ecafb36bde63a0 /src/test/incremental
parent1d468400f5bf205a92eabdededc17e0a2789d651 (diff)
parent00f6e3918dc84503f97e5575924465dc145ced7a (diff)
downloadrust-24ea08e9b7c206ee7a0de76b68072e46fc230cbd.tar.gz
rust-24ea08e9b7c206ee7a0de76b68072e46fc230cbd.zip
Auto merge of #41905 - frewsxcv:rollup, r=frewsxcv
Rollup of 5 pull requests

- Successful merges: #41192, #41724, #41873, #41877, #41889
- Failed merges:
Diffstat (limited to 'src/test/incremental')
-rw-r--r--src/test/incremental/remove_source_file/auxiliary/mod.rs13
-rw-r--r--src/test/incremental/remove_source_file/main.rs31
2 files changed, 44 insertions, 0 deletions
diff --git a/src/test/incremental/remove_source_file/auxiliary/mod.rs b/src/test/incremental/remove_source_file/auxiliary/mod.rs
new file mode 100644
index 00000000000..a2cea65a309
--- /dev/null
+++ b/src/test/incremental/remove_source_file/auxiliary/mod.rs
@@ -0,0 +1,13 @@
+// Copyright 2017 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 print_hello() {
+    println!("hello");
+}
diff --git a/src/test/incremental/remove_source_file/main.rs b/src/test/incremental/remove_source_file/main.rs
new file mode 100644
index 00000000000..4ba33f3bb3d
--- /dev/null
+++ b/src/test/incremental/remove_source_file/main.rs
@@ -0,0 +1,31 @@
+// Copyright 2017 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.
+
+// This test case makes sure that the compiler doesn't crash due to a failing
+// table lookup when a source file is removed.
+
+// revisions:rpass1 rpass2
+
+// Note that we specify -g so that the FileMaps actually get referenced by the
+// incr. comp. cache:
+// compile-flags: -Z query-dep-graph -g
+
+#[cfg(rpass1)]
+mod auxiliary;
+
+#[cfg(rpass1)]
+fn main() {
+    auxiliary::print_hello();
+}
+
+#[cfg(rpass2)]
+fn main() {
+    println!("hello");
+}