2025-06-29 21:05:19 +05:00
|
|
|
//! Test that nested block comments are properly supported by the parser.
|
|
|
|
|
//!
|
|
|
|
|
//! See <https://github.com/rust-lang/rust/issues/66>.
|
|
|
|
|
|
2019-07-27 00:54:25 +03:00
|
|
|
//@ run-pass
|
2015-03-22 13:13:15 -07:00
|
|
|
|
2013-10-18 22:51:57 +02:00
|
|
|
/* This test checks that nested comments are supported
|
2012-09-07 16:58:27 -07:00
|
|
|
|
2025-06-29 21:05:19 +05:00
|
|
|
/* This is a nested comment
|
|
|
|
|
/* And this is even more deeply nested */
|
|
|
|
|
Back to the first level of nesting
|
2012-09-07 16:58:27 -07:00
|
|
|
*/
|
2025-06-29 21:05:19 +05:00
|
|
|
|
|
|
|
|
/* Another nested comment at the same level */
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
/* Additional test cases for nested comments */
|
|
|
|
|
|
|
|
|
|
#[rustfmt::skip]
|
|
|
|
|
/*
|
|
|
|
|
/* Level 1
|
|
|
|
|
/* Level 2
|
|
|
|
|
/* Level 3 */
|
|
|
|
|
*/
|
|
|
|
|
*/
|
2012-09-07 16:58:27 -07:00
|
|
|
*/
|
|
|
|
|
|
2013-10-18 22:51:57 +02:00
|
|
|
pub fn main() {
|
2025-06-29 21:05:19 +05:00
|
|
|
// Check that code after nested comments works correctly
|
|
|
|
|
let _x = 42;
|
|
|
|
|
|
|
|
|
|
/* Even inline /* nested */ comments work */
|
|
|
|
|
let _y = /* nested /* comment */ test */ 100;
|
2012-09-07 16:58:27 -07:00
|
|
|
}
|