mirror of
https://github.com/rust-lang/rust-clippy
synced 2024-12-18 00:53:31 +00:00
Fix issue with DOC_MARKDOWN
and punctuation
This commit is contained in:
parent
397b940225
commit
e14e1a7148
2 changed files with 12 additions and 3 deletions
|
@ -133,9 +133,6 @@ pub fn check_doc(cx: &EarlyContext, valid_idents: &[String], doc: &str, span: Sp
|
||||||
match chars.next() {
|
match chars.next() {
|
||||||
Some((_, c)) => {
|
Some((_, c)) => {
|
||||||
match c {
|
match c {
|
||||||
c if c.is_whitespace() => {
|
|
||||||
current_word_begin = jump_to!(@next_char, chars, len);
|
|
||||||
}
|
|
||||||
'`' => {
|
'`' => {
|
||||||
current_word_begin = jump_to!(chars, '`', len);
|
current_word_begin = jump_to!(chars, '`', len);
|
||||||
}
|
}
|
||||||
|
@ -171,6 +168,10 @@ pub fn check_doc(cx: &EarlyContext, valid_idents: &[String], doc: &str, span: Sp
|
||||||
None => return,
|
None => return,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
// anything that’s neither alphanumeric nor '_' is not part of an ident anyway
|
||||||
|
c if !c.is_alphanumeric() && c != '_' => {
|
||||||
|
current_word_begin = jump_to!(@next_char, chars, len);
|
||||||
|
}
|
||||||
_ => {
|
_ => {
|
||||||
let end = match chars.find(|&(_, c)| !is_word_char(c)) {
|
let end = match chars.find(|&(_, c)| !is_word_char(c)) {
|
||||||
Some((end, _)) => end,
|
Some((end, _)) => end,
|
||||||
|
|
|
@ -107,3 +107,11 @@ fn main() {
|
||||||
test_emphasis();
|
test_emphasis();
|
||||||
test_units();
|
test_units();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// I am confused by brackets? (`x_y`)
|
||||||
|
/// I am confused by brackets? (foo `x_y`)
|
||||||
|
/// I am confused by brackets? (`x_y` foo)
|
||||||
|
/// be_sure_we_got_to_the_end_of_it
|
||||||
|
//~^ ERROR: you should put `be_sure_we_got_to_the_end_of_it` between ticks
|
||||||
|
fn issue900() {
|
||||||
|
}
|
||||||
|
|
Loading…
Reference in a new issue