Debian Codegraph @

tests/fixtures/invalid/union-attributes.rs

raw symbols SCIP
1 use daft::Diffable;
2
3 #[derive(Diffable)]
4 #[daft(leaf)]
5 union MyUnion {
6 #[daft(leaf)]
7 a: i32,
8 #[daft(ignore)]
9 b: u32,
10 }
11
12 #[derive(Diffable)]
13 #[daft(ignore)]
14 union MyUnion2 {
15 a: i32,
16 b: u32,
17 }
18
19 fn main() {
20 // MyEnum/MyEnum2 and its Diffable impl should all exist.
21 let before = MyUnion { a: 0 };
22 let after = MyUnion { b: 1 };
23
24 let _diff = before.diff(&after);
25
26 let before = MyUnion2 { a: 0 };
27 let after = MyUnion2 { a: 1 };
28
29 let _diff = before.diff(&after);
30 }