diff --git a/crates/re_types/definitions/rerun/archetypes/points2d.fbs b/crates/re_types/definitions/rerun/archetypes/points2d.fbs index a837b5c8b7f8..d16250144acd 100644 --- a/crates/re_types/definitions/rerun/archetypes/points2d.fbs +++ b/crates/re_types/definitions/rerun/archetypes/points2d.fbs @@ -28,7 +28,7 @@ namespace rerun.archetypes; /// \rs \include:../../../../../docs/code-examples/point2d_simple_v2.rs /// \rs ``` table Points2D ( - "attr.rust.derive": "Debug, Clone, PartialEq", + "attr.rust.derive": "PartialEq", order: 100 ) { // --- Required --- diff --git a/crates/re_types/definitions/rerun/components/class_id.fbs b/crates/re_types/definitions/rerun/components/class_id.fbs index c5a272ae5836..29f5070a44ec 100644 --- a/crates/re_types/definitions/rerun/components/class_id.fbs +++ b/crates/re_types/definitions/rerun/components/class_id.fbs @@ -15,7 +15,7 @@ struct ClassId ( "attr.python.aliases": "int", "attr.python.array_aliases": "int, npt.NDArray[np.uint8], npt.NDArray[np.uint16], npt.NDArray[np.uint32], npt.NDArray[np.uint64]", "attr.rerun.legacy_fqname": "rerun.class_id", - "attr.rust.derive": "Copy, Clone, Debug, Default, PartialEq, Eq, PartialOrd, Ord, Hash", + "attr.rust.derive": "Copy, Default, PartialEq, Eq, PartialOrd, Ord, Hash", "attr.rust.tuple_struct", order: 100 ) { diff --git a/crates/re_types/definitions/rerun/components/color.fbs b/crates/re_types/definitions/rerun/components/color.fbs index 58809d919480..0f1f356b9bc2 100644 --- a/crates/re_types/definitions/rerun/components/color.fbs +++ b/crates/re_types/definitions/rerun/components/color.fbs @@ -18,7 +18,7 @@ struct Color ( "attr.python.aliases": "int, Sequence[int], npt.NDArray[Union[np.uint8, np.float32, np.float64]]", "attr.python.array_aliases": "Sequence[Sequence[int]], npt.NDArray[Union[np.uint8, np.uint32, np.float32, np.float64]]", "attr.rerun.legacy_fqname": "rerun.colorrgba", - "attr.rust.derive": "Debug, Default, Clone, Copy, PartialEq, Eq, PartialOrd, Ord, bytemuck::Pod, bytemuck::Zeroable", + "attr.rust.derive": "Default, Copy, PartialEq, Eq, PartialOrd, Ord, bytemuck::Pod, bytemuck::Zeroable", "attr.rust.repr": "transparent", "attr.rust.tuple_struct", order: 100 diff --git a/crates/re_types/definitions/rerun/components/draw_order.fbs b/crates/re_types/definitions/rerun/components/draw_order.fbs index 15c73388ff7a..6ddee0b07af9 100644 --- a/crates/re_types/definitions/rerun/components/draw_order.fbs +++ b/crates/re_types/definitions/rerun/components/draw_order.fbs @@ -20,7 +20,7 @@ struct DrawOrder ( "attr.python.aliases": "float", "attr.python.array_aliases": "npt.NDArray[np.float32]", "attr.rerun.legacy_fqname": "rerun.draw_order", - "attr.rust.derive": "Debug, Clone, Copy", + "attr.rust.derive": "Copy", "attr.rust.repr": "transparent", "attr.rust.tuple_struct", order: 100 diff --git a/crates/re_types/definitions/rerun/components/instance_key.fbs b/crates/re_types/definitions/rerun/components/instance_key.fbs index 5ba7d0a41279..14eaae7279c7 100644 --- a/crates/re_types/definitions/rerun/components/instance_key.fbs +++ b/crates/re_types/definitions/rerun/components/instance_key.fbs @@ -15,7 +15,7 @@ struct InstanceKey ( "attr.python.array_aliases": "npt.NDArray[np.uint64]", "attr.rerun.legacy_fqname": "rerun.instance_key", "attr.rust.tuple_struct", - "attr.rust.derive": "Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord", + "attr.rust.derive": "Copy, PartialEq, Eq, PartialOrd, Ord", order: 100 ) { value: uint64; diff --git a/crates/re_types/definitions/rerun/components/keypoint_id.fbs b/crates/re_types/definitions/rerun/components/keypoint_id.fbs index 164650b1f60b..386f119c45fb 100644 --- a/crates/re_types/definitions/rerun/components/keypoint_id.fbs +++ b/crates/re_types/definitions/rerun/components/keypoint_id.fbs @@ -22,7 +22,7 @@ struct KeypointId ( "attr.python.aliases": "float", "attr.python.array_aliases": "npt.NDArray[np.uint8], npt.NDArray[np.uint16], npt.NDArray[np.uint32]", "attr.rerun.legacy_fqname": "rerun.keypoint_id", - "attr.rust.derive": "Copy, Clone, Debug, Default, PartialEq, Eq, PartialOrd, Ord, Hash", + "attr.rust.derive": "Copy, Default, PartialEq, Eq, PartialOrd, Ord, Hash", "attr.rust.tuple_struct", order: 200 ) { diff --git a/crates/re_types/definitions/rerun/components/label.fbs b/crates/re_types/definitions/rerun/components/label.fbs index 391b87005a16..e0c4497264a0 100644 --- a/crates/re_types/definitions/rerun/components/label.fbs +++ b/crates/re_types/definitions/rerun/components/label.fbs @@ -14,7 +14,7 @@ table Label ( "attr.python.aliases": "str", "attr.python.array_aliases": "Sequence[str]", "attr.rerun.legacy_fqname": "rerun.label", - "attr.rust.derive": "Debug, Clone, PartialEq, Eq, PartialOrd, Ord", + "attr.rust.derive": "PartialEq, Eq, PartialOrd, Ord", "attr.rust.repr": "transparent", "attr.rust.tuple_struct", order: 100 diff --git a/crates/re_types/definitions/rerun/components/point2d.fbs b/crates/re_types/definitions/rerun/components/point2d.fbs index 09d00d3dd757..87b4656bc16d 100644 --- a/crates/re_types/definitions/rerun/components/point2d.fbs +++ b/crates/re_types/definitions/rerun/components/point2d.fbs @@ -15,7 +15,7 @@ struct Point2D ( "attr.python.aliases": "npt.NDArray[np.float32], Sequence[float], Tuple[float, float]", "attr.python.array_aliases": "npt.NDArray[np.float32], Sequence[float]", "attr.rerun.legacy_fqname": "rerun.point2d", - "attr.rust.derive": "Debug, Default, Clone, Copy, PartialEq, PartialOrd", + "attr.rust.derive": "Default, Copy, PartialEq, PartialOrd", order: 100 ) { xy: rerun.datatypes.Point2D (order: 100); diff --git a/crates/re_types/definitions/rerun/components/radius.fbs b/crates/re_types/definitions/rerun/components/radius.fbs index 13232ecf79dc..0b5ece13b705 100644 --- a/crates/re_types/definitions/rerun/components/radius.fbs +++ b/crates/re_types/definitions/rerun/components/radius.fbs @@ -15,7 +15,7 @@ struct Radius ( "attr.python.array_aliases": "npt.NDArray[np.float32]", "attr.rerun.legacy_fqname": "rerun.radius", "attr.rust.tuple_struct", - "attr.rust.derive": "Debug, Clone, Copy, PartialEq, PartialOrd", + "attr.rust.derive": "Copy, PartialEq, PartialOrd", order: 100 ) { value: float; diff --git a/crates/re_types/definitions/rerun/datatypes/point2d.fbs b/crates/re_types/definitions/rerun/datatypes/point2d.fbs index 6fd963408127..4669c9cf9ad5 100644 --- a/crates/re_types/definitions/rerun/datatypes/point2d.fbs +++ b/crates/re_types/definitions/rerun/datatypes/point2d.fbs @@ -11,7 +11,7 @@ namespace rerun.datatypes; struct Point2D ( "attr.python.aliases": "Sequence[float]", "attr.python.array_aliases": "npt.NDArray[np.float32], Sequence[npt.NDArray[np.float32]], Sequence[Tuple[float, float]], Sequence[float]", - "attr.rust.derive": "Debug, Default, Clone, Copy, PartialEq, PartialOrd", + "attr.rust.derive": "Default, Copy, PartialEq, PartialOrd", order: 100 ) { x: float (order: 100); diff --git a/crates/re_types/definitions/rerun/datatypes/vec2d.fbs b/crates/re_types/definitions/rerun/datatypes/vec2d.fbs index e3cf2b5dc835..5d2bf97b99e2 100644 --- a/crates/re_types/definitions/rerun/datatypes/vec2d.fbs +++ b/crates/re_types/definitions/rerun/datatypes/vec2d.fbs @@ -12,7 +12,7 @@ struct Vec2D ( "attr.arrow.transparent", "attr.python.aliases": "Tuple[float, float]", "attr.python.array_aliases": "npt.NDArray[np.float32], Sequence[Tuple[float, float]], Sequence[float]", - "attr.rust.derive": "Debug, Default, Clone, Copy, PartialEq, PartialOrd", + "attr.rust.derive": "Default, Copy, PartialEq, PartialOrd", "attr.rust.tuple_struct", order: 100 ) { diff --git a/crates/re_types/definitions/rerun/testing/archetypes/fuzzy.fbs b/crates/re_types/definitions/rerun/testing/archetypes/fuzzy.fbs index 96864a08551c..913ff36b497c 100644 --- a/crates/re_types/definitions/rerun/testing/archetypes/fuzzy.fbs +++ b/crates/re_types/definitions/rerun/testing/archetypes/fuzzy.fbs @@ -12,7 +12,7 @@ namespace rerun.testing.archetypes; // - required affects the nullability of the element values for the underlying array (both native and arrow) table AffixFuzzer1 ( - "attr.rust.derive": "Debug, Clone, PartialEq", + "attr.rust.derive": "PartialEq", order: 100 ) { fuzz1001: rerun.testing.components.AffixFuzzer1 ("attr.rerun.component_required", required, order: 1001); diff --git a/crates/re_types/definitions/rerun/testing/components/fuzzy.fbs b/crates/re_types/definitions/rerun/testing/components/fuzzy.fbs index 11f6cc94c38e..aed3208d2244 100644 --- a/crates/re_types/definitions/rerun/testing/components/fuzzy.fbs +++ b/crates/re_types/definitions/rerun/testing/components/fuzzy.fbs @@ -9,14 +9,14 @@ namespace rerun.testing.components; // --- table AffixFuzzer1 ( - "attr.rust.derive": "Debug, Clone, PartialEq", + "attr.rust.derive": "PartialEq", order: 100 ) { single_required: rerun.testing.datatypes.AffixFuzzer1 (required); } table AffixFuzzer2 ( - "attr.rust.derive": "Debug, Clone, PartialEq", + "attr.rust.derive": "PartialEq", "attr.rust.tuple_struct", order: 200 ) { @@ -24,21 +24,21 @@ table AffixFuzzer2 ( } table AffixFuzzer3 ( - "attr.rust.derive": "Debug, Clone, PartialEq", + "attr.rust.derive": "PartialEq", order: 300 ) { single_required: rerun.testing.datatypes.AffixFuzzer1 (required); } table AffixFuzzer4 ( - "attr.rust.derive": "Debug, Clone, PartialEq", + "attr.rust.derive": "PartialEq", order: 400 ) { single_optional: rerun.testing.datatypes.AffixFuzzer1; } table AffixFuzzer5 ( - "attr.rust.derive": "Debug, Clone, PartialEq", + "attr.rust.derive": "PartialEq", "attr.rust.tuple_struct", order: 500 ) { @@ -46,56 +46,56 @@ table AffixFuzzer5 ( } table AffixFuzzer6 ( - "attr.rust.derive": "Debug, Clone, PartialEq", + "attr.rust.derive": "PartialEq", order: 600 ) { single_optional: rerun.testing.datatypes.AffixFuzzer1; } table AffixFuzzer7 ( - "attr.rust.derive": "Debug, Clone, PartialEq", + "attr.rust.derive": "PartialEq", order: 700 ) { many_optional: [rerun.testing.datatypes.AffixFuzzer1] (order: 100); } table AffixFuzzer8 ( - "attr.rust.derive": "Debug, Clone, PartialEq", + "attr.rust.derive": "PartialEq", order: 800 ) { single_float_optional: float (order: 101); } table AffixFuzzer9 ( - "attr.rust.derive": "Debug, Clone, PartialEq, Eq", + "attr.rust.derive": "PartialEq, Eq", order: 900 ) { single_string_required: string (order: 102, required); } table AffixFuzzer10 ( - "attr.rust.derive": "Debug, Clone, PartialEq, Eq", + "attr.rust.derive": "PartialEq, Eq", order: 1000 ) { single_string_optional: string (order: 103); } table AffixFuzzer11 ( - "attr.rust.derive": "Debug, Clone, PartialEq", + "attr.rust.derive": "PartialEq", order: 1100 ) { many_floats_optional: [float] (order: 104); } table AffixFuzzer12 ( - "attr.rust.derive": "Debug, Clone, PartialEq, Eq", + "attr.rust.derive": "PartialEq, Eq", order: 1200 ) { many_strings_required: [string] (order: 105, required); } table AffixFuzzer13 ( - "attr.rust.derive": "Debug, Clone, PartialEq, Eq", + "attr.rust.derive": "PartialEq, Eq", order: 1300 ) { many_strings_optional: [string] (order: 106); @@ -103,7 +103,7 @@ table AffixFuzzer13 ( // TODO(cmc): the ugly bug we need to take care of at some point // table AffixFuzzer14 ( -// "attr.rust.derive": "Debug, Clone, PartialEq", +// "attr.rust.derive": "PartialEq", // order: 1400 // ) { // diff --git a/crates/re_types/definitions/rerun/testing/datatypes/fuzzy.fbs b/crates/re_types/definitions/rerun/testing/datatypes/fuzzy.fbs index 3588b55af442..6bc62ddd44f1 100644 --- a/crates/re_types/definitions/rerun/testing/datatypes/fuzzy.fbs +++ b/crates/re_types/definitions/rerun/testing/datatypes/fuzzy.fbs @@ -7,7 +7,7 @@ namespace rerun.testing.datatypes; // --- table AffixFuzzer1 ( - "attr.rust.derive": "Debug, Clone, PartialEq", + "attr.rust.derive": "PartialEq", order: 100 ) { single_float_optional: float (order: 101); @@ -20,7 +20,7 @@ table AffixFuzzer1 ( table AffixFuzzer2 ( "attr.arrow.transparent", - "attr.rust.derive": "Debug, Clone, PartialEq", + "attr.rust.derive": "PartialEq", "attr.rust.tuple_struct", order: 200 ) { diff --git a/crates/re_types/definitions/rust/attributes.fbs b/crates/re_types/definitions/rust/attributes.fbs index eba209568488..cdfd7ad46eb8 100644 --- a/crates/re_types/definitions/rust/attributes.fbs +++ b/crates/re_types/definitions/rust/attributes.fbs @@ -8,7 +8,7 @@ attribute "attr.rust.tuple_struct"; /// Apply to any object to generate a #derive clause. /// /// The value of the attribute will be trimmed out but otherwise left as-is. -/// E.g. "attr.rust.derive": "Debug, Clone, Copy"`. +/// E.g. "attr.rust.derive": "Copy"`. attribute "attr.rust.derive"; /// Apply to any object to generate a #repr clause with the specified value. diff --git a/crates/re_types/source_hash.txt b/crates/re_types/source_hash.txt index 8fb67070b9db..4b15921d0d74 100644 --- a/crates/re_types/source_hash.txt +++ b/crates/re_types/source_hash.txt @@ -1,4 +1,4 @@ # This is a sha256 hash for all direct and indirect dependencies of this crate's build script. # It can be safely removed at anytime to force the build script to run again. # Check out build.rs to see how it's computed. -fe95d42267d6803af40c31b57c2fe5fc59b898b7bb718e2b461400bd83fd16d6 \ No newline at end of file +65d6bf828303169287dd4a8df605e50acbde791fa0f2e8167ea751fd23d3a56f \ No newline at end of file diff --git a/crates/re_types/src/components/class_id.rs b/crates/re_types/src/components/class_id.rs index 22191277f35d..d933a96f0828 100644 --- a/crates/re_types/src/components/class_id.rs +++ b/crates/re_types/src/components/class_id.rs @@ -12,7 +12,7 @@ #[doc = "A 16-bit ID representing a type of semantic class."] #[doc = ""] #[doc = "Used to look up a `crate::components::ClassDescription` within the `crate::components::AnnotationContext`."] -#[derive(Copy, Clone, Debug, Default, PartialEq, Eq, PartialOrd, Ord, Hash)] +#[derive(Debug, Clone, Copy, Default, PartialEq, Eq, PartialOrd, Ord, Hash)] pub struct ClassId(pub u16); impl<'a> From for ::std::borrow::Cow<'a, ClassId> { diff --git a/crates/re_types/src/components/color.rs b/crates/re_types/src/components/color.rs index 685af5c7fa85..173c4ec566e1 100644 --- a/crates/re_types/src/components/color.rs +++ b/crates/re_types/src/components/color.rs @@ -12,8 +12,8 @@ #[doc = "An RGBA color tuple with unmultiplied/separate alpha, in sRGB gamma space with linear alpha."] #[derive( Debug, - Default, Clone, + Default, Copy, PartialEq, Eq, diff --git a/crates/re_types/src/components/keypoint_id.rs b/crates/re_types/src/components/keypoint_id.rs index a9a84c28896a..89f2ed75550d 100644 --- a/crates/re_types/src/components/keypoint_id.rs +++ b/crates/re_types/src/components/keypoint_id.rs @@ -14,7 +14,7 @@ #[doc = "`KeypointId`s are only meaningful within the context of a `crate::components::ClassDescription`."] #[doc = ""] #[doc = "Used to look up an `crate::components::AnnotationInfo` for a Keypoint within the `crate::components::AnnotationContext`."] -#[derive(Copy, Clone, Debug, Default, PartialEq, Eq, PartialOrd, Ord, Hash)] +#[derive(Debug, Clone, Copy, Default, PartialEq, Eq, PartialOrd, Ord, Hash)] pub struct KeypointId(pub u16); impl<'a> From for ::std::borrow::Cow<'a, KeypointId> { diff --git a/crates/re_types/src/components/point2d.rs b/crates/re_types/src/components/point2d.rs index 472f08f7cdd6..6e760006fd6d 100644 --- a/crates/re_types/src/components/point2d.rs +++ b/crates/re_types/src/components/point2d.rs @@ -10,7 +10,7 @@ #![allow(clippy::unnecessary_cast)] #[doc = "A point in 2D space."] -#[derive(Debug, Default, Clone, Copy, PartialEq, PartialOrd)] +#[derive(Debug, Clone, Default, Copy, PartialEq, PartialOrd)] pub struct Point2D { pub xy: crate::datatypes::Point2D, } diff --git a/crates/re_types/src/datatypes/point2d.rs b/crates/re_types/src/datatypes/point2d.rs index d702f49f68e0..aeaa30f98303 100644 --- a/crates/re_types/src/datatypes/point2d.rs +++ b/crates/re_types/src/datatypes/point2d.rs @@ -10,7 +10,7 @@ #![allow(clippy::unnecessary_cast)] #[doc = "A point in 2D space."] -#[derive(Debug, Default, Clone, Copy, PartialEq, PartialOrd)] +#[derive(Debug, Clone, Default, Copy, PartialEq, PartialOrd)] pub struct Point2D { pub x: f32, pub y: f32, diff --git a/crates/re_types/src/datatypes/vec2d.rs b/crates/re_types/src/datatypes/vec2d.rs index 89c42ec71741..b07a8ca7b8d8 100644 --- a/crates/re_types/src/datatypes/vec2d.rs +++ b/crates/re_types/src/datatypes/vec2d.rs @@ -10,7 +10,7 @@ #![allow(clippy::unnecessary_cast)] #[doc = "A vector in 2D space."] -#[derive(Debug, Default, Clone, Copy, PartialEq, PartialOrd)] +#[derive(Debug, Clone, Default, Copy, PartialEq, PartialOrd)] pub struct Vec2D(pub [f32; 2usize]); impl<'a> From for ::std::borrow::Cow<'a, Vec2D> { diff --git a/crates/re_types_builder/src/codegen/rust.rs b/crates/re_types_builder/src/codegen/rust.rs index b3b61d781364..7a443ad6fea7 100644 --- a/crates/re_types_builder/src/codegen/rust.rs +++ b/crates/re_types_builder/src/codegen/rust.rs @@ -492,6 +492,11 @@ fn quote_meta_clause_from_obj(obj: &Object, attr: &str, clause: &str) -> TokenSt let quoted = obj .try_get_attr::(attr) .map(|what| { + let what = if clause == "derive" { + format!("Debug, Clone, {what}") + } else { + what + }; syn::parse_str::(&format!("{clause}({what})")) .with_context(|| format!("illegal meta clause: {what:?}")) .unwrap()