File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -591,7 +591,7 @@ struct types, except that it must specify exactly one field:
591591
592592``` rust
593593# union MyUnion { f1 : u32 , f2 : f32 }
594-
594+ #
595595let u = MyUnion { f1 : 1 };
596596```
597597
@@ -612,7 +612,7 @@ union fields have to be placed in `unsafe` blocks.
612612``` rust
613613# union MyUnion { f1 : u32 , f2 : f32 }
614614# let u = MyUnion { f1 : 1 };
615-
615+ #
616616unsafe {
617617 let f = u . f1;
618618}
@@ -624,7 +624,7 @@ so these writes don't have to be placed in `unsafe` blocks
624624``` rust
625625# union MyUnion { f1 : u32 , f2 : f32 }
626626# let mut u = MyUnion { f1 : 1 };
627-
627+ #
628628u . f1 = 2 ;
629629```
630630
@@ -639,7 +639,7 @@ to be placed in `unsafe` blocks as well.
639639
640640``` rust
641641# union MyUnion { f1 : u32 , f2 : f32 }
642-
642+ #
643643fn f (u : MyUnion ) {
644644 unsafe {
645645 match u {
You can’t perform that action at this time.
0 commit comments