summaryrefslogtreecommitdiffstats
path: root/tests/ui/lexer
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-17 12:20:39 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-17 12:20:39 +0000
commit1376c5a617be5c25655d0d7cb63e3beaa5a6e026 (patch)
tree3bb8d61aee02bc7a15eab3f36e3b921afc2075d0 /tests/ui/lexer
parentReleasing progress-linux version 1.69.0+dfsg1-1~progress7.99u1. (diff)
downloadrustc-1376c5a617be5c25655d0d7cb63e3beaa5a6e026.tar.xz
rustc-1376c5a617be5c25655d0d7cb63e3beaa5a6e026.zip
Merging upstream version 1.70.0+dfsg1.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'tests/ui/lexer')
-rw-r--r--tests/ui/lexer/lexer-crlf-line-endings-string-literal-doc-comment.rs1
-rw-r--r--tests/ui/lexer/unterminated-comment.rs1
-rw-r--r--tests/ui/lexer/unterminated-comment.stderr9
-rw-r--r--tests/ui/lexer/unterminated-nested-comment.rs4
-rw-r--r--tests/ui/lexer/unterminated-nested-comment.stderr21
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`.