diff options
| author | Matthias Krüger <476013+matthiaskrgr@users.noreply.github.com> | 2025-09-24 20:34:21 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-09-24 20:34:21 +0200 |
| commit | 4e225ee72dfe55a249f09dc40a0c4c58f29b637c (patch) | |
| tree | 61a90a7a8d75b5a61e165b448c932d2da0fd2519 /tests | |
| parent | 79bb3c487998988253b34455a9fd4e1c93a3ead1 (diff) | |
| parent | 82c4018619b8ec48807151ce1164c9649e998b4d (diff) | |
Rollup merge of #146897 - lolbinarycat:rustdoc-invalid_html_tags-ice-146890, r=GuillaumeGomez
fix ICE in rustdoc::invalid_html_tags fixes https://github.com/rust-lang/rust/issues/146890 r? ```@GuillaumeGomez```
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/rustdoc-ui/lints/invalid-html-tags-ice-146890.rs | 25 | ||||
| -rw-r--r-- | tests/rustdoc-ui/lints/invalid-html-tags-ice-146890.stderr | 38 |
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 + |
