We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 0e78361 + 8497800 commit 8453534Copy full SHA for 8453534
tests/codegen/issues/issue-122600-ptr-discriminant-update.rs
@@ -0,0 +1,19 @@
1
+//@ compile-flags: -O
2
+//@ min-llvm-version: 19
3
+
4
+#![crate_type = "lib"]
5
6
+pub enum State {
7
+ A([u8; 753]),
8
+ B([u8; 753]),
9
+}
10
11
+// CHECK-LABEL: @update
12
+#[no_mangle]
13
+pub unsafe fn update(s: *mut State) {
14
+ // CHECK-NEXT: start:
15
+ // CHECK-NEXT: store i8
16
+ // CHECK-NEXT: ret
17
+ let State::A(v) = s.read() else { std::hint::unreachable_unchecked() };
18
+ s.write(State::B(v));
19
0 commit comments