Skip to content
This repository was archived by the owner on Aug 16, 2021. It is now read-only.

Rename lint unused_doc_comment to unused_doc_comments #246

Closed
wants to merge 1 commit into from

Conversation

hoodie
Copy link

@hoodie hoodie commented May 27, 2018

No description provided.

@bjgill
Copy link
Contributor

bjgill commented May 30, 2018

This looks to be a useful PR, thanks. Is this back-compatible? The travis failure perhaps suggests not.

EDIT: it looks as if you might want something like:

diff --git a/src/error_chain.rs b/src/error_chain.rs
index ddba192..3ef7dc2 100644
--- a/src/error_chain.rs
+++ b/src/error_chain.rs
@@ -179,7 +179,7 @@ macro_rules! impl_error_chain_processed {
                 self.description()
             }
 
-            #[allow(unknown_lints, unused_doc_comments)]
+            #[allow(unknown_lints, unused_doc_comment, unused_doc_comment, unused_doc_comments)]
             fn cause(&self) -> Option<&::std::error::Error> {
                 match self.1.next_error {
                     Some(ref c) => Some(&**c),
@@ -421,7 +421,7 @@ macro_rules! impl_extract_backtrace {
     ($error_name: ident
      $error_kind_name: ident
      $([$link_error_path: path, $(#[$meta_links: meta])*])*) => {
-        #[allow(unknown_lints, unused_doc_comments)]
+        #[allow(unknown_lints, unused_doc_comment, unused_doc_comments)]
         fn extract_backtrace(e: &(::std::error::Error + Send + 'static))
             -> Option<$crate::InternalBacktrace> {
             if let Some(e) = e.downcast_ref::<$error_name>() {
diff --git a/src/impl_error_chain_kind.rs b/src/impl_error_chain_kind.rs
index 2d51a92..6c89d00 100644
--- a/src/impl_error_chain_kind.rs
+++ b/src/impl_error_chain_kind.rs
@@ -224,7 +224,7 @@ macro_rules! impl_error_chain_kind {
             $item:ident: $imode:tt [$(#[$imeta:meta])*] [$( $var:ident: $typ:ty ),*] {$( $funcs:tt )*}
         )*}
     ) => {
-        #[allow(unknown_lints, unused, unused_doc_comments)]
+        #[allow(unknown_lints, unused, unused_doc_comment, unused_doc_comments)]
         impl ::std::fmt::Display for $name {
             fn fmt(&self, fmt: &mut ::std::fmt::Formatter)
                 -> ::std::fmt::Result
@@ -247,7 +247,7 @@ macro_rules! impl_error_chain_kind {
                 }
             }
         }
-        #[allow(unknown_lints, unused, unused_doc_comments)]
+        #[allow(unknown_lints, unused, unused_doc_comment, unused_doc_comments)]
         impl $name {
             /// A string describing the error kind.
             pub fn description(&self) -> &str {

@df5602
Copy link

df5602 commented May 30, 2018

@bjgill Won't this still generate the same warnings that prompted this pull request? (see issue #245 )

@bjgill
Copy link
Contributor

bjgill commented May 31, 2018

Good point - we also need to allow renamed_and_removed_lints. I've done that in https://github.com/bjgill/error-chain/tree/lint-problem, which compiles without warnings in both stable and nightly (c.f. this PR, which has warnings ins stable, and master, which has warnings in nightly).

@hoodie - do you want to take on my back-compatibility enhancement (or equivalent)? Otherwise, I'll open a new PR tomorrow.

@TedDriggs
Copy link
Contributor

What are the cases that generate unused doc comments? If we can fix those, then we can remove the lint outright, and have no version compatibility concerns.

@bjgill
Copy link
Contributor

bjgill commented Jun 5, 2018

I believe the problem is #63 (attribute handling in links)

@Yamakaky
Copy link
Contributor

Closing for #247

@Yamakaky Yamakaky closed this Jun 16, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants