diff options
Diffstat (limited to 'tests/ui/lexer')
5 files changed, 35 insertions, 1 deletions
diff --git a/tests/ui/lexer/lexer-crlf-line-endings-string-literal-doc-comment.rs b/tests/ui/lexer/lexer-crlf-line-endings-string-literal-doc-comment.rs index 802be7f5a..9ba01540a 100644 --- a/tests/ui/lexer/lexer-crlf-line-endings-string-literal-doc-comment.rs +++ b/tests/ui/lexer/lexer-crlf-line-endings-string-literal-doc-comment.rs @@ -6,7 +6,6 @@ // N.B., this file needs CRLF line endings. The .gitattributes file in
// this directory should enforce it.
-// ignore-pretty issue #37195
/// Doc comment that ends in CRLF
pub fn foo() {}
diff --git a/tests/ui/lexer/unterminated-comment.rs b/tests/ui/lexer/unterminated-comment.rs new file mode 100644 index 000000000..1cfdfb1fb --- /dev/null +++ b/tests/ui/lexer/unterminated-comment.rs @@ -0,0 +1 @@ +/* //~ ERROR E0758 diff --git a/tests/ui/lexer/unterminated-comment.stderr b/tests/ui/lexer/unterminated-comment.stderr new file mode 100644 index 000000000..c513fafee --- /dev/null +++ b/tests/ui/lexer/unterminated-comment.stderr @@ -0,0 +1,9 @@ +error[E0758]: unterminated block comment + --> $DIR/unterminated-comment.rs:1:1 + | +LL | /* + | ^^^^^^^^^^^^^^^^^^^ + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0758`. diff --git a/tests/ui/lexer/unterminated-nested-comment.rs b/tests/ui/lexer/unterminated-nested-comment.rs new file mode 100644 index 000000000..db5f2f3ba --- /dev/null +++ b/tests/ui/lexer/unterminated-nested-comment.rs @@ -0,0 +1,4 @@ +/* //~ ERROR E0758 +/* */ +/* +*/ diff --git a/tests/ui/lexer/unterminated-nested-comment.stderr b/tests/ui/lexer/unterminated-nested-comment.stderr new file mode 100644 index 000000000..3653e76c9 --- /dev/null +++ b/tests/ui/lexer/unterminated-nested-comment.stderr @@ -0,0 +1,21 @@ +error[E0758]: unterminated block comment + --> $DIR/unterminated-nested-comment.rs:1:1 + | +LL | /* + | ^- + | | + | _unterminated block comment + | | +LL | | /* */ +LL | | /* + | | -- + | | | + | | ...as last nested comment starts here, maybe you want to close this instead? +LL | | */ + | |_--^ + | | + | ...and last nested comment terminates here. + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0758`. |