diff options
| author | Corey Farwell <coreyf@rwell.org> | 2017-05-11 00:21:26 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2017-05-11 00:21:26 -0400 |
| commit | 4ad75b317f8672f62ca7abcc9bdb33a0d71476fe (patch) | |
| tree | 8644f33ec0dcfb1b5f4eddb926dc146fc4dbfba3 /src/test | |
| parent | 183dd9e3c2586ccba3a8215469e1e57843d83973 (diff) | |
| parent | 84a40c14430566b94a238d5399929bc16867f519 (diff) | |
Rollup merge of #41873 - michaelwoerister:fix-filemap-hash-lookup, r=nikomatsakis
ICH: Handle case of removed FileMaps. This PR fixes a bug introduced in #41709 where removing a source file between compilation sessions would cause an ICE: https://travis-ci.org/rust-icci/crossbeam/jobs/230582234#L633 r? @nikomatsakis
Diffstat (limited to 'src/test')
| -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"); +} |
