Skip to content

Commit 59c8278

Browse files
committed
Delete empty derives
1 parent 5e2b3f2 commit 59c8278

5 files changed

Lines changed: 1 addition & 11 deletions

File tree

‎cpp2rust/converter/models/converter_refcount.cpp‎

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -499,13 +499,8 @@ void ConverterRefCount::EmitRustUnion(clang::RecordDecl *decl) {
499499
auto attrs = GetStructAttributes(decl);
500500
Mapper::SetDerives(ctx_.getCanonicalTagType(decl),
501501
std::vector<std::string>(attrs.begin(), attrs.end()));
502-
StrCat("#[derive(");
503-
for (auto *attr : attrs) {
504-
StrCat(attr, ',');
505-
}
506-
StrCat(")]");
507502

508-
StrCat(std::format("pub struct {} {{ __bytes: Value<Box<[u8]>>, }}", name));
503+
StrCat(std::format("pub struct {} {{ __bytes: Value<Box<[u8]>> }}", name));
509504

510505
StrCat(std::format("impl {}", name));
511506
{

‎tests/unit/out/refcount/tag_vs_identifier_collision.rs‎

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,6 @@ impl ByteRepr for point_struct {
4747
}
4848
}
4949
}
50-
#[derive()]
5150
pub struct point {
5251
__bytes: Value<Box<[u8]>>,
5352
}
@@ -74,7 +73,6 @@ impl Default for point {
7473
}
7574
}
7675
impl ByteRepr for point {}
77-
#[derive()]
7876
pub struct slot_union {
7977
__bytes: Value<Box<[u8]>>,
8078
}

‎tests/unit/out/refcount/union_basic.rs‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ use std::io::prelude::*;
66
use std::io::{Read, Seek, Write};
77
use std::os::fd::AsFd;
88
use std::rc::{Rc, Weak};
9-
#[derive()]
109
pub struct basic {
1110
__bytes: Value<Box<[u8]>>,
1211
}

‎tests/unit/out/refcount/union_pointer_pun_writethrough.rs‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ pub fn main() {
1111
}
1212
fn main_0() -> i32 {
1313
let x: Value<i64> = Rc::new(RefCell::new((-1_i32 as i64)));
14-
#[derive()]
1514
pub struct anon_0 {
1615
__bytes: Value<Box<[u8]>>,
1716
}

‎tests/unit/out/refcount/union_tagged_struct_arms.rs‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,6 @@ impl ByteRepr for anon_3 {
8080
}
8181
}
8282
}
83-
#[derive()]
8483
pub struct anon_0 {
8584
__bytes: Value<Box<[u8]>>,
8685
}

0 commit comments

Comments
 (0)