about summary refs log tree commit diff
diff options
context:
space:
mode:
authorMatthias Krüger <matthias.krueger@famsik.de>2024-04-28 01:25:00 +0200
committerGitHub <noreply@github.com>2024-04-28 01:25:00 +0200
commit289bf549adee20ba5f1f0c9073a054e83f652ee6 (patch)
tree50321f373c54a88003b19fbb9adc4892573a07aa
parent8ef4a8df4b3b0ca68ad24e8167834cd9e774ab84 (diff)
parent8088ea0ba026127786b23c516d1371d5e06eef30 (diff)
downloadrust-289bf549adee20ba5f1f0c9073a054e83f652ee6.tar.gz
rust-289bf549adee20ba5f1f0c9073a054e83f652ee6.zip
Rollup merge of #124165 - matthiaskrgr:slice-pattern-const-ice-incr, r=Mark-Simulacrum
add test for incremental ICE: slice-pattern-const.rs #83085

Fixes #83085
-rw-r--r--tests/incremental/slice-pattern-const-ice-83085.rs39
1 files changed, 39 insertions, 0 deletions
diff --git a/tests/incremental/slice-pattern-const-ice-83085.rs b/tests/incremental/slice-pattern-const-ice-83085.rs
new file mode 100644
index 00000000000..4d318fd7ec1
--- /dev/null
+++ b/tests/incremental/slice-pattern-const-ice-83085.rs
@@ -0,0 +1,39 @@
+//@ compile-flags: -Zincremental-verify-ich=yes
+// issue: rust-lang/rust#83085 incremental ICE: forcing query with already existing `DepNode`
+// this used to fail to build straight away without needing any kind of
+// stage1/2 builds but tidy demands it
+//@ revisions:rpass1 rpass2
+
+fn main() {
+    const BOO: &[u8; 0] = &[];
+    match &[] {
+        BOO => (),
+        b"" => (),
+        _ => (),
+    }
+}
+
+#[derive(PartialEq, Eq)]
+struct Id<'a> {
+    ns: &'a str,
+}
+fn visit_struct() {
+    let id = Id { ns: "random1" };
+    const FLAG: Id<'static> = Id {
+        ns: "needs_to_be_the_same",
+    };
+    match id {
+        FLAG => {}
+        _ => {}
+    }
+}
+fn visit_struct2() {
+    let id = Id { ns: "random2" };
+    const FLAG: Id<'static> = Id {
+        ns: "needs_to_be_the_same",
+    };
+    match id {
+        FLAG => {}
+        _ => {}
+    }
+}