I’m very new to Rust. However, I’ve noticed something about the Rust comment syntax that might be considered a shortcoming, although definitely not a serious one.
This is a valid line comment in Rust:
// a strange comment */ wierd stuff
However, currently if I try to comment out a block of code containing this line comment, using block comments, it does not work:
/* // a strange comment */ wierd stuff */
because the block comment ends at the */ inside the line comment, leaving the ‘wierd stuff’ outside the comment, as well as the trailing */. In other words, the line comment does not properly nest inside of the block comment.
While this could definitely fall into the category of ‘just don’t do that’, it probably would not be too difficult to make line comments properly nest inside of block comments, so that any star-slash or slash-star or that occurs inside a line comment is effectively escaped from the point of view of any containing block comment.