Ignore mix of {,non-}sugared doc in doc_markdown

This commit is contained in:
mcarton 2017-05-30 19:50:07 +02:00
parent 81b0efa094
commit 9881b15822
2 changed files with 14 additions and 0 deletions

View file

@ -126,6 +126,11 @@ pub fn check_attrs<'a>(cx: &EarlyContext, valid_idents: &[String], attrs: &'a [a
spans.extend_from_slice(&current_spans); spans.extend_from_slice(&current_spans);
doc.push_str(&current); doc.push_str(&current);
} }
} else if let Some(name) = attr.name() {
// ignore mix of sugared and non-sugared doc
if name == "doc" {
return;
}
} }
} }

View file

@ -144,3 +144,12 @@ fn four_quotes() {
/// [NIST SP 800-56A, revision 2]: /// [NIST SP 800-56A, revision 2]:
/// https://github.com/Manishearth/rust-clippy/issues/902#issuecomment-261919419 /// https://github.com/Manishearth/rust-clippy/issues/902#issuecomment-261919419
fn issue_902_comment() {} 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() {}