Debian Codegraph @

tests/ui/pass/struct_with_extra_field.rs

raw symbols SCIP
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 }