Skip to content

Commit 6a78240

Browse files
committed
docs formmated | nested-block-comment.rs
1 parent 6d60002 commit 6a78240

File tree

1 file changed

+27
-2
lines changed

1 file changed

+27
-2
lines changed
Lines changed: 27 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,36 @@
1+
//! Test that nested block comments are properly supported by the parser.
2+
//!
3+
//! This is a historical test from the early days of Rust development when
4+
//! multi-line comment support was first implemented.
5+
//!
6+
//! See <https://github.com/rust-lang/rust/issues/66>.
7+
18
//@ run-pass
29

310
/* This test checks that nested comments are supported
411
5-
/*
6-
This should not panic
12+
/* This is a nested comment
13+
/* And this is even more deeply nested */
14+
Back to the first level of nesting
715
*/
16+
17+
/* Another nested comment at the same level */
18+
*/
19+
20+
/* Additional test cases for nested comments */
21+
22+
/*
23+
/* Level 1
24+
/* Level 2
25+
/* Level 3 */
26+
*/
27+
*/
828
*/
929

1030
pub fn main() {
31+
// Check that code after nested comments works correctly
32+
let _x = 42;
33+
34+
/* Even inline /* nested */ comments work */
35+
let _y = /* nested /* comment */ test */ 100;
1136
}

0 commit comments

Comments
 (0)