Skip to content

Commit

Permalink
Ignore mix of {,non-}sugared doc in doc_markdown
Browse files Browse the repository at this point in the history
  • Loading branch information
mcarton committed Jun 17, 2017
1 parent 81b0efa commit 9881b15
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
5 changes: 5 additions & 0 deletions clippy_lints/src/doc.rs
Expand Up @@ -126,6 +126,11 @@ pub fn check_attrs<'a>(cx: &EarlyContext, valid_idents: &[String], attrs: &'a [a
spans.extend_from_slice(&current_spans);
doc.push_str(&current);
}
} else if let Some(name) = attr.name() {
// ignore mix of sugared and non-sugared doc
if name == "doc" {
return;
}
}
}

Expand Down
9 changes: 9 additions & 0 deletions clippy_tests/examples/doc.rs
Expand Up @@ -144,3 +144,12 @@ fn four_quotes() {
/// [NIST SP 800-56A, revision 2]:
/// https://github.com/Manishearth/rust-clippy/issues/902#issuecomment-261919419
fn issue_902_comment() {}

#[cfg_attr(feature = "a", doc = " ```")]
#[cfg_attr(not(feature = "a"), doc = " ```ignore")]
/// fn main() {
/// let s = "localhost:10000".to_string();
/// println!("{}", s);
/// }
/// ```
fn issue_1469() {}

0 comments on commit 9881b15

Please sign in to comment.