about summary refs log tree commit diff
path: root/src/test
diff options
context:
space:
mode:
authorCorey Farwell <coreyf@rwell.org>2017-02-08 10:19:52 -0500
committerGitHub <noreply@github.com>2017-02-08 10:19:52 -0500
commit944933ef4e81abd6048287b2c257e883c04f7757 (patch)
tree8ed214e3f98e6a97c74b430b2064abf131b306ac /src/test
parente0eeb6e63725ccd007a2d308924e91cc87e88fde (diff)
parent4f5fc4e24219f64235f08ba91ccf4b447a8643ee (diff)
Rollup merge of #39582 - nikomatsakis:incr-comp-issue-39569, r=michaelwoerister
Handle the case where an intermediate node can't be recreated

This solution grows the graph, but this is quite the corner case.

r? @michaelwoerister
Diffstat (limited to 'src/test')
-rw-r--r--src/test/incremental/issue-39569.rs38
1 files changed, 38 insertions, 0 deletions
diff --git a/src/test/incremental/issue-39569.rs b/src/test/incremental/issue-39569.rs
new file mode 100644
index 00000000000..5b53e948253
--- /dev/null
+++ b/src/test/incremental/issue-39569.rs
@@ -0,0 +1,38 @@
+// 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.
+
+// Regression test for a weird corner case in our dep-graph reduction
+// code. When we solve `CoerceUnsized<Foo>`, we find no impls, so we
+// don't end up with an edge to any HIR nodes, but it still gets
+// preserved in the dep graph.
+
+// revisions:rpass1 rpass2
+// compile-flags: -Z query-dep-graph
+
+use std::sync::Arc;
+
+#[cfg(rpass1)]
+struct Foo { x: usize }
+
+#[cfg(rpass1)]
+fn main() {
+    let x: Arc<Foo> = Arc::new(Foo { x: 22 });
+    let y: Arc<Foo> = x;
+}
+
+#[cfg(rpass2)]
+struct FooX { x: usize }
+
+#[cfg(rpass2)]
+fn main() {
+    let x: Arc<FooX> = Arc::new(FooX { x: 22 });
+    let y: Arc<FooX> = x;
+}
+