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 ca8266e commit 72039f3Copy full SHA for 72039f3
cyclonedx-bom-macros/tests/ui/fail/duplicated_struct.rs
@@ -0,0 +1,15 @@
1
+use cyclonedx_bom_macros::versioned;
2
+
3
+#[versioned("1.0", "2.0")]
4
+mod base {
5
+ // Define `Foo` for 1.0 twice
6
+ #[versioned("1.0")]
7
+ pub struct Foo;
8
9
10
11
+}
12
13
+fn main() {
14
+ let _ = v1_0::Foo;
15
cyclonedx-bom-macros/tests/ui/fail/duplicated_struct.stderr
@@ -0,0 +1,10 @@
+error[E0428]: the name `Foo` is defined multiple times
+ --> tests/ui/fail/duplicated_struct.rs:10:5
+ |
+7 | pub struct Foo;
+ | --------------- previous definition of the type `Foo` here
+...
+10 | pub struct Foo;
+ | ^^^^^^^^^^^^^^^ `Foo` redefined here
+ = note: `Foo` must be defined only once in the type namespace of this module
0 commit comments