mirror of
https://github.com/rust-lang/rust.git
synced 2025-01-19 11:12:43 +00:00
Remove colon from faulty span
This commit is contained in:
parent
e6e696f7b0
commit
c720a3a38e
@ -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)
|
||||
|
@ -15,6 +15,11 @@ pub struct Foo {
|
||||
pub i: TypeForPublicField
|
||||
}
|
||||
|
||||
// #1095
|
||||
struct S<T: /* comment */> {
|
||||
t: T,
|
||||
}
|
||||
|
||||
// #1029
|
||||
pub struct Foo {
|
||||
#[doc(hidden)]
|
||||
|
@ -14,6 +14,11 @@ pub struct Foo {
|
||||
pub i: TypeForPublicField,
|
||||
}
|
||||
|
||||
// #1095
|
||||
struct S<T /* comment */> {
|
||||
t: T,
|
||||
}
|
||||
|
||||
// #1029
|
||||
pub struct Foo {
|
||||
#[doc(hidden)]
|
||||
|
Loading…
Reference in New Issue
Block a user