Repository: tokio-rs/prost (language: rust)

Issue:
Missing documentation for ::prost::Oneof
Thanks for prost. I use it for a lot of projects and it has served us well.

Recently, my company started using `#![deny(missing_docs)]`, and I am getting the following error:
```
warning: missing documentation for a method
   |
10 |     #[derive(Clone, PartialEq, ::prost::Oneof)]
   |                                ^^^^^^^^^^^^^^

```

How can I add a docstring for `::prost::Oneof`? It is not a matter of it being documented in the prost crate itself, as denying missing docs ignores docs outside of my project, so there must be a way for me to document it within my project, right? Or if not, perhaps there should be?

Thanks.



Discussion / hints:
Ping!  I'm running into the same issue, except it's missing documentation for the nested enum wrapper modules.  I'd really love to not have to make exceptions for all my message types.
Agree with @sezna  -- thanks for prost!  It's quite great.

I made a little repo that reproduces this problem here: https://github.com/cbrune/prost-doc

I'm happy to help, but need to be pointed in the right direction.

Fix patch:
diff --git a/prost-derive/src/lib.rs b/prost-derive/src/lib.rs
index ad1aa19cf..71497be57 100644
--- a/prost-derive/src/lib.rs
+++ b/prost-derive/src/lib.rs
@@ -424,12 +424,14 @@ fn try_oneof(input: TokenStream) -> Result<TokenStream, Error> {
 
     let expanded = quote! {
         impl #impl_generics #ident #ty_generics #where_clause {
+            /// Encodes the message to a buffer.
             pub fn encode<B>(&self, buf: &mut B) where B: ::prost::bytes::BufMut {
                 match *self {
                     #(#encode,)*
                 }
             }
 
+            /// Decodes an instance of the message from a buffer, and merges it into self.
             pub fn merge<B>(
                 field: &mut ::core::option::Option<#ident #ty_generics>,
                 tag: u32,
@@ -444,6 +446,7 @@ fn try_oneof(input: TokenStream) -> Result<TokenStream, Error> {
                 }
             }
 
+            /// Returns the encoded length of the message without a length delimiter.
             #[inline]
             pub fn encoded_len(&self) -> usize {
                 match *self {


Test patch: