Skip to content

Commit 4e6c0ce

Browse files
Mitchell KemberRebase bot
Mitchell Kember
authored and
Rebase bot
committed
[fidl][rust] Put #[allow(dead_code)] on empty services
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]>
1 parent dd909bc commit 4e6c0ce

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

tools/fidl/fidlgen_rust/codegen/service.tmpl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ impl fidl::endpoints::ServiceRequest for {{ .Name }}Request {
5858
///{{ . }}
5959
{{- end }}
6060
#[cfg(target_os = "fuchsia")]
61-
pub struct {{ .Name }}Proxy(Box<dyn fidl::endpoints::MemberOpener>);
61+
pub struct {{ .Name }}Proxy({{ if not .Members }}#[allow(dead_code)] {{ end }}Box<dyn fidl::endpoints::MemberOpener>);
6262

6363
#[cfg(target_os = "fuchsia")]
6464
impl fidl::endpoints::ServiceProxy for {{ .Name }}Proxy {

tools/fidl/fidlgen_rust/goldens/service.rs.golden

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -656,7 +656,7 @@ impl fidl::endpoints::ServiceRequest for EmptyServiceRequest {
656656
}
657657
}
658658
#[cfg(target_os = "fuchsia")]
659-
pub struct EmptyServiceProxy(Box<dyn fidl::endpoints::MemberOpener>);
659+
pub struct EmptyServiceProxy(#[allow(dead_code)] Box<dyn fidl::endpoints::MemberOpener>);
660660

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

0 commit comments

Comments
 (0)