Skip to content

Commit

Permalink
[fidl][rust] Put #[allow(dead_code)] on empty services
Browse files Browse the repository at this point in the history
Since rust-lang/rust#118297, Rust treats unused
tuple struct fields as dead code. This CL adds an #[allow(dead_code)] to
silence the warning.

Bug: 318827209
Change-Id: I6858165a085a0ef508722c1ce38f3d95866d2867
Reviewed-on: https://fuchsia-review.googlesource.com/c/fuchsia/+/972128
Reviewed-by: David Koloski <[email protected]>
Commit-Queue: Auto-Submit <[email protected]>
Fuchsia-Auto-Submit: Mitchell Kember <[email protected]>
  • Loading branch information
Mitchell Kember authored and Rebase bot committed Jan 11, 2024
1 parent dd909bc commit 4e6c0ce
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion tools/fidl/fidlgen_rust/codegen/service.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ impl fidl::endpoints::ServiceRequest for {{ .Name }}Request {
///{{ . }}
{{- end }}
#[cfg(target_os = "fuchsia")]
pub struct {{ .Name }}Proxy(Box<dyn fidl::endpoints::MemberOpener>);
pub struct {{ .Name }}Proxy({{ if not .Members }}#[allow(dead_code)] {{ end }}Box<dyn fidl::endpoints::MemberOpener>);

#[cfg(target_os = "fuchsia")]
impl fidl::endpoints::ServiceProxy for {{ .Name }}Proxy {
Expand Down
2 changes: 1 addition & 1 deletion tools/fidl/fidlgen_rust/goldens/service.rs.golden
Original file line number Diff line number Diff line change
Expand Up @@ -656,7 +656,7 @@ impl fidl::endpoints::ServiceRequest for EmptyServiceRequest {
}
}
#[cfg(target_os = "fuchsia")]
pub struct EmptyServiceProxy(Box<dyn fidl::endpoints::MemberOpener>);
pub struct EmptyServiceProxy(#[allow(dead_code)] Box<dyn fidl::endpoints::MemberOpener>);

#[cfg(target_os = "fuchsia")]
impl fidl::endpoints::ServiceProxy for EmptyServiceProxy {
Expand Down

0 comments on commit 4e6c0ce

Please sign in to comment.