Skip to content

Commit 9a8c5a3

Browse files
committed
add test for incremental ICE: slice-pattern-const.rs #83085
Fixes #83085
1 parent 07d0d7c commit 9a8c5a3

File tree

1 file changed

+39
-0
lines changed

1 file changed

+39
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
//@ compile-flags: -Zincremental-verify-ich=yes
2+
// issue: rust-lang/rust#83085 incremental ICE: forcing query with already existing `DepNode`
3+
// this used to fail to build straight away without needing any kind of stage1/2 builds but tidy demands it
4+
//@ revisions:rpass1 rpass2
5+
6+
fn main() {
7+
const BOO: &[u8; 0] = &[];
8+
match &[] {
9+
BOO => (),
10+
b"" => (),
11+
_ => (),
12+
}
13+
}
14+
15+
#[derive(PartialEq, Eq)]
16+
struct Id<'a> {
17+
ns: &'a str,
18+
}
19+
fn visit_struct() {
20+
let id = Id { ns: "random1" };
21+
const FLAG: Id<'static> = Id {
22+
ns: "needs_to_be_the_same",
23+
};
24+
match id {
25+
FLAG => {}
26+
_ => {}
27+
}
28+
}
29+
fn visit_struct2() {
30+
let id = Id { ns: "random2" };
31+
const FLAG: Id<'static> = Id {
32+
ns: "needs_to_be_the_same",
33+
};
34+
match id {
35+
FLAG => {}
36+
_ => {}
37+
}
38+
}
39+

0 commit comments

Comments
 (0)