about summary refs log tree commit diff
path: root/tests/ui/codegen
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2024-12-13 23:09:16 +0000
committerbors <bors@rust-lang.org>2024-12-13 23:09:16 +0000
commit4a204bebdfd5cbc3e7edabf41cda3c3ff8b74917 (patch)
tree1086f7934aef657a18dccfbb61c907bc3ac0c92e /tests/ui/codegen
parent327c7ee4367ea587a49eff1d4715f462ab6db5f0 (diff)
parent8cce32ae2bc8a065ca2841a72ae032c5820a6436 (diff)
downloadrust-4a204bebdfd5cbc3e7edabf41cda3c3ff8b74917.tar.gz
rust-4a204bebdfd5cbc3e7edabf41cda3c3ff8b74917.zip
Auto merge of #134269 - matthiaskrgr:rollup-fkshwux, r=matthiaskrgr
Rollup of 7 pull requests

Successful merges:

 - #133900 (Advent of `tests/ui` (misc cleanups and improvements) [1/N])
 - #133937 (Keep track of parse errors in `mod`s and don't emit resolve errors for paths involving them)
 - #133938 (`rustc_mir_dataflow` cleanups, including some renamings)
 - #134058 (interpret: reduce usage of TypingEnv::fully_monomorphized)
 - #134130 (Stop using driver queries in the public API)
 - #134140 (Add AST support for unsafe binders)
 - #134229 (Fix typos in docs on provenance)

r? `@ghost`
`@rustbot` modify labels: rollup
Diffstat (limited to 'tests/ui/codegen')
-rw-r--r--tests/ui/codegen/alias-uninit-value.rs26
1 files changed, 26 insertions, 0 deletions
diff --git a/tests/ui/codegen/alias-uninit-value.rs b/tests/ui/codegen/alias-uninit-value.rs
new file mode 100644
index 00000000000..a8aa94caaf2
--- /dev/null
+++ b/tests/ui/codegen/alias-uninit-value.rs
@@ -0,0 +1,26 @@
+//! Regression test for issue #374, where previously rustc performed conditional jumps or moves that
+//! incorrectly depended on uninitialized values.
+//!
+//! Issue: <https://github.com/rust-lang/rust/issues/374>.
+
+//@ run-pass
+
+#![allow(dead_code)]
+
+enum TyS {
+    Nil,
+}
+
+struct RawT {
+    struct_: TyS,
+    cname: Option<String>,
+    hash: usize,
+}
+
+fn mk_raw_ty(st: TyS, cname: Option<String>) -> RawT {
+    return RawT { struct_: st, cname: cname, hash: 0 };
+}
+
+pub fn main() {
+    mk_raw_ty(TyS::Nil, None::<String>);
+}