diff --git a/ipc/codegen/src/codegen.rs b/ipc/codegen/src/codegen.rs index 2f4e1608f..4709eceaf 100644 --- a/ipc/codegen/src/codegen.rs +++ b/ipc/codegen/src/codegen.rs @@ -305,7 +305,7 @@ pub fn strip_ptr(ty: &P) -> P { else { ty.clone() } } -fn has_ptr(ty: &P) -> bool { +pub fn has_ptr(ty: &P) -> bool { if let ast::TyKind::Rptr(_, ref _ptr_mut) = ty.node { true } diff --git a/ipc/codegen/src/serialization.rs b/ipc/codegen/src/serialization.rs index a7e172ee1..65d94d162 100644 --- a/ipc/codegen/src/serialization.rs +++ b/ipc/codegen/src/serialization.rs @@ -111,6 +111,7 @@ fn serialize_item( ).unwrap()) } +#[allow(unreachable_code)] fn binary_expr( cx: &ExtCtxt, builder: &aster::AstBuilder, @@ -128,7 +129,7 @@ fn binary_expr( item.span, variant_data, ) - } + }, ast::ItemKind::Enum(ref enum_def, _) => { binary_expr_enum( cx, @@ -139,7 +140,7 @@ fn binary_expr( item.span, enum_def, ) - } + }, _ => { cx.span_bug(item.span, "expected ItemStruct or ItemEnum in #[derive(Binary)]"); @@ -255,10 +256,11 @@ fn binary_expr_struct( }) } +#[allow(unreachable_code)] fn binary_expr_item_struct( cx: &ExtCtxt, builder: &aster::AstBuilder, - impl_generics: &ast::Generics, + _impl_generics: &ast::Generics, ty: P, span: Span, variant_data: &ast::VariantData,