about summary refs log tree commit diff
path: root/tests/rustdoc-ui
diff options
context:
space:
mode:
authorbinarycat <binarycat@envs.net>2025-09-22 11:20:52 -0500
committerbinarycat <binarycat@envs.net>2025-09-22 14:57:36 -0500
commit82c4018619b8ec48807151ce1164c9649e998b4d (patch)
tree2efa0106d8fe92b39a68769ec8d08fd4036f7461 /tests/rustdoc-ui
parent6710835ae739ca326441ff6c63d24fb123858300 (diff)
downloadrust-82c4018619b8ec48807151ce1164c9649e998b4d.tar.gz
rust-82c4018619b8ec48807151ce1164c9649e998b4d.zip
fix ICE in rustdoc::invalid_html_tags
Diffstat (limited to 'tests/rustdoc-ui')
-rw-r--r--tests/rustdoc-ui/lints/invalid-html-tags-ice-146890.rs25
-rw-r--r--tests/rustdoc-ui/lints/invalid-html-tags-ice-146890.stderr38
2 files changed, 63 insertions, 0 deletions
diff --git a/tests/rustdoc-ui/lints/invalid-html-tags-ice-146890.rs b/tests/rustdoc-ui/lints/invalid-html-tags-ice-146890.rs
new file mode 100644
index 00000000000..d7efc201e7e
--- /dev/null
+++ b/tests/rustdoc-ui/lints/invalid-html-tags-ice-146890.rs
@@ -0,0 +1,25 @@
+// this test ensures that bad HTML with multiline tags doesn't cause an ICE
+// regression test for https://github.com/rust-lang/rust/issues/146890
+#[deny(rustdoc::invalid_html_tags)]
+
+/// <TABLE
+/// BORDER>
+/// <TR
+/// >
+/// <TH
+//~^ ERROR: unclosed HTML tag `TH`
+/// >key
+/// </TD
+//~^ ERROR: unopened HTML tag `TD`
+/// >
+/// <TH
+//~^ ERROR: unclosed HTML tag `TH`
+/// >value
+/// </TD
+//~^ ERROR: unopened HTML tag `TD`
+/// >
+/// </TR
+/// >
+/// </TABLE
+/// >
+pub fn foo() {}
diff --git a/tests/rustdoc-ui/lints/invalid-html-tags-ice-146890.stderr b/tests/rustdoc-ui/lints/invalid-html-tags-ice-146890.stderr
new file mode 100644
index 00000000000..64a82b3a952
--- /dev/null
+++ b/tests/rustdoc-ui/lints/invalid-html-tags-ice-146890.stderr
@@ -0,0 +1,38 @@
+error: unopened HTML tag `TD`
+  --> $DIR/invalid-html-tags-ice-146890.rs:12:5
+   |
+LL |   /// </TD
+   |  _____^
+LL | |
+LL | | /// >
+   | |_____^
+   |
+note: the lint level is defined here
+  --> $DIR/invalid-html-tags-ice-146890.rs:3:8
+   |
+LL | #[deny(rustdoc::invalid_html_tags)]
+   |        ^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+error: unopened HTML tag `TD`
+  --> $DIR/invalid-html-tags-ice-146890.rs:18:5
+   |
+LL |   /// </TD
+   |  _____^
+LL | |
+LL | | /// >
+   | |_____^
+
+error: unclosed HTML tag `TH`
+  --> $DIR/invalid-html-tags-ice-146890.rs:9:5
+   |
+LL | /// <TH
+   |     ^^^
+
+error: unclosed HTML tag `TH`
+  --> $DIR/invalid-html-tags-ice-146890.rs:15:5
+   |
+LL | /// <TH
+   |     ^^^
+
+error: aborting due to 4 previous errors
+