Skip to content

Commit d8a420a

Browse files
committed
Document and tidy up alias-uninit-value.rs
1 parent f415c07 commit d8a420a

File tree

1 file changed

+17
-9
lines changed

1 file changed

+17
-9
lines changed

tests/ui/alias-uninit-value.rs

Lines changed: 17 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,27 @@
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+
16
//@ run-pass
27

38
#![allow(non_camel_case_types)]
49
#![allow(dead_code)]
510

11+
enum sty {
12+
ty_nil,
13+
}
614

7-
8-
// Regression test for issue #374
9-
10-
11-
enum sty { ty_nil, }
12-
13-
struct RawT {struct_: sty, cname: Option<String>, hash: usize}
15+
struct RawT {
16+
struct_: sty,
17+
cname: Option<String>,
18+
hash: usize,
19+
}
1420

1521
fn mk_raw_ty(st: sty, cname: Option<String>) -> RawT {
16-
return RawT {struct_: st, cname: cname, hash: 0};
22+
return RawT { struct_: st, cname: cname, hash: 0 };
1723
}
1824

19-
pub fn main() { mk_raw_ty(sty::ty_nil, None::<String>); }
25+
pub fn main() {
26+
mk_raw_ty(sty::ty_nil, None::<String>);
27+
}

0 commit comments

Comments
 (0)