Skip to content

Commit

Permalink
Allow dead_code lint for truncated structs too
Browse files Browse the repository at this point in the history
  • Loading branch information
sdroege committed Aug 5, 2024
1 parent 0599607 commit ae08ff9
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/codegen/sys/lib_.rs
Original file line number Diff line number Diff line change
Expand Up @@ -547,6 +547,11 @@ fn generate_from_fields(
generate_opaque_type(w, &fields.name)?;
} else {
writeln!(w, "#[repr(C)]")?;

if fields.truncated.is_some() {
writeln!(w, "#[allow(dead_code)]")?;
}

writeln!(
w,
"pub {kind} {name} {{",
Expand Down

0 comments on commit ae08ff9

Please sign in to comment.