diff options
| author | Niko Matsakis <niko@alum.mit.edu> | 2017-02-06 09:37:32 -0500 |
|---|---|---|
| committer | Niko Matsakis <niko@alum.mit.edu> | 2017-02-06 09:37:32 -0500 |
| commit | b9757863df0c30fbff1a6b4c95c48342d25e9b4a (patch) | |
| tree | 280af2c6c666bc58dee3b09cd3b8d989f8b07c67 | |
| parent | b3096e25c0a574cb20706adabe75667a215a86b9 (diff) | |
| download | rust-b9757863df0c30fbff1a6b4c95c48342d25e9b4a.tar.gz rust-b9757863df0c30fbff1a6b4c95c48342d25e9b4a.zip | |
regr test
| -rw-r--r-- | src/test/incremental/issue-39569.rs | 38 |
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..55e0436f0a8 --- /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(Foo { x: 22 }); + let y: Arc<FooX> = x; +} + |
