We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 0cd5996 commit 7ecc460Copy full SHA for 7ecc460
cyclonedx-bom-macros/tests/ui/pass/struct_with_extra_field.rs
@@ -0,0 +1,16 @@
1
+use cyclonedx_bom_macros::versioned;
2
+
3
+#[versioned("1.0", "2.0")]
4
+mod base {
5
+ pub struct Foo {
6
+ #[versioned("2.0")]
7
+ // This field only exists in version 2.0.
8
+ pub bar: u32,
9
+ }
10
+}
11
12
+fn main() {
13
+ // Version 1.0 does not have the `bar` field but 2.0 does.
14
+ let _old_foo = v1_0::Foo {};
15
+ let _new_foo = v2_0::Foo { bar: 0 };
16
0 commit comments