Advertisement
Guest User

Untitled

a guest
Nov 13th, 2019
104
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Rust 0.25 KB | None | 0 0
  1. const std = @import("std");
  2.  
  3. const Union = union(enum) {
  4.     First: void,
  5.     Second: void,
  6. };
  7.  
  8. fn main() void {
  9.     var x = Union{ .First = {} };
  10.     std.debug.warn("{}\n", x);
  11.     x = Union { .Second = {} };
  12.     std.debug.warn("{}\n", x);
  13. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement