Skip to content

Commit 6fa1fff

Browse files
committed
Bless test for constant queries.
As the hash function for the input is not complete, those queries can trigger a re-use of a DepNode. As we now tolerate having duplicated DepNode, we effectively remove this ICE.
1 parent 537ae41 commit 6fa1fff

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed

tests/incremental/issue-101518.rs

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,11 @@
1-
// revisions: cpass
1+
// This test creates 2 constants that have the same contents but a different AllocId.
2+
// When hashed, those two contants would have the same stable hash. From the point of view
3+
// of the query system, the two calls to `try_destructure_mir_constant` would have the same
4+
// `DepNode` but with different inputs.
5+
//
6+
// This test verifies that the query system does not ICE in such cases.
7+
//
8+
// revisions: cpass1 cpass2
29

310
#[derive(PartialEq, Eq)]
411
struct Id<'a> {
@@ -21,4 +28,7 @@ fn visit_struct2() {
2128
}
2229
}
2330

24-
fn main() {}
31+
fn main() {
32+
visit_struct();
33+
visit_struct2();
34+
}

0 commit comments

Comments
 (0)