Skip to content
This repository was archived by the owner on May 28, 2025. It is now read-only.

Commit cbc5841

Browse files
committed
add tests interleaving doc attrib comments and regular comments
1 parent 6c96ab7 commit cbc5841

File tree

2 files changed

+21
-1
lines changed

2 files changed

+21
-1
lines changed

tests/source/doc-attrib.rs

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,22 @@ mod tests {
1818
#[doc = "Level 3 comment"]
1919
fn f() {
2020
#[doc = "Level 4 comment"]
21-
fn g() {
21+
fn g() {
2222
}
2323
}
2424
}
2525
}
2626

27+
struct C {
28+
#[doc = "item doc attrib comment"]
29+
// regular item comment
30+
b: i32,
31+
32+
// regular item comment
33+
#[doc = "item doc attrib comment"]
34+
c: i32,
35+
}
36+
2737
// non-regression test for regular attributes, from #2647
2838
#[cfg(feature = "this_line_is_101_characters_long_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx")]
2939
pub fn foo() {}

tests/target/doc-attrib.rs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,16 @@ mod tests {
2828
}
2929
}
3030

31+
struct C {
32+
/// item doc attrib comment
33+
// regular item comment
34+
b: i32,
35+
36+
// regular item comment
37+
/// item doc attrib comment
38+
c: i32,
39+
}
40+
3141
// non-regression test for regular attributes, from #2647
3242
#[cfg(
3343
feature = "this_line_is_101_characters_long_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"

0 commit comments

Comments
 (0)