Remove colon from faulty span

This commit is contained in:
Seiichi Uchida 2017-09-05 01:04:31 +09:00
parent e6e696f7b0
commit c720a3a38e
3 changed files with 11 additions and 1 deletions

View File

@ -641,7 +641,7 @@ where
self.prev_span_end = (self.get_hi)(&item) + BytePos(comment_end as u32);
let post_snippet = post_snippet[..comment_end].trim();
let post_snippet_trimmed = if post_snippet.starts_with(',') {
let post_snippet_trimmed = if post_snippet.starts_with(|c| c == ',' || c == ':') {
post_snippet[1..].trim_matches(white_space)
} else if post_snippet.ends_with(',') {
post_snippet[..(post_snippet.len() - 1)].trim_matches(white_space)

View File

@ -15,6 +15,11 @@ pub struct Foo {
pub i: TypeForPublicField
}
// #1095
struct S<T: /* comment */> {
t: T,
}
// #1029
pub struct Foo {
#[doc(hidden)]

View File

@ -14,6 +14,11 @@ pub struct Foo {
pub i: TypeForPublicField,
}
// #1095
struct S<T /* comment */> {
t: T,
}
// #1029
pub struct Foo {
#[doc(hidden)]