about summary refs log tree commit diff
path: root/tests/ui/codegen/alias-uninit-value.rs
blob: a8aa94caaf285973c38580e6945fda78ec7dc8b9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
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>);
}