diff options
| author | Michael Woerister <michaelwoerister@posteo.net> | 2017-05-10 11:00:08 +0200 |
|---|---|---|
| committer | Michael Woerister <michaelwoerister@posteo.net> | 2017-05-10 12:35:36 +0200 |
| commit | 84a40c14430566b94a238d5399929bc16867f519 (patch) | |
| tree | dd528f09122432bd2351f9976d5e5d20ceb02968 /src/test/incremental/remove_source_file | |
| parent | 58b33ad70cdd11f9ce7b5874c6effab9627e51aa (diff) | |
ICH: Handle case of removed FileMaps.
Diffstat (limited to 'src/test/incremental/remove_source_file')
| -rw-r--r-- | src/test/incremental/remove_source_file/auxiliary/mod.rs | 13 | ||||
| -rw-r--r-- | src/test/incremental/remove_source_file/main.rs | 31 |
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"); +} |
