Skip to content

Commit dd3b313

Browse files
committed
Adjust alias-uninit-value.rs
- Document and tidy up `alias-uninit-value.rs` - Move `alias-uninit-value.rs` to `tests/ui/codegen/`
1 parent 974ccc1 commit dd3b313

File tree

2 files changed

+26
-19
lines changed

2 files changed

+26
-19
lines changed

tests/ui/alias-uninit-value.rs

-19
This file was deleted.
+26
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
//! Regression test for issue #374, where previously rustc performed conditional jumps or moves that
2+
//! incorrectly depended on uninitialized values.
3+
//!
4+
//! Issue: <https://github.com/rust-lang/rust/issues/374>.
5+
6+
//@ run-pass
7+
8+
#![allow(dead_code)]
9+
10+
enum TyS {
11+
Nil,
12+
}
13+
14+
struct RawT {
15+
struct_: TyS,
16+
cname: Option<String>,
17+
hash: usize,
18+
}
19+
20+
fn mk_raw_ty(st: TyS, cname: Option<String>) -> RawT {
21+
return RawT { struct_: st, cname: cname, hash: 0 };
22+
}
23+
24+
pub fn main() {
25+
mk_raw_ty(TyS::Nil, None::<String>);
26+
}

0 commit comments

Comments
 (0)