Skip to content

Commit b2321bb

Browse files
Add test for invalid_html_tag lint in deny(rustdoc)
1 parent 6163d89 commit b2321bb

File tree

2 files changed

+25
-1
lines changed

2 files changed

+25
-1
lines changed

src/test/rustdoc-ui/lint-group.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,3 +22,8 @@ pub fn no_doctest() {} //~^ ERROR missing code example in this documentation
2222
/// println!("sup");
2323
/// ```
2424
fn private_doctest() {} //~^^^^^ ERROR documentation test in private item
25+
26+
/// <unknown>
27+
//~^ ERROR unclosed HTML tag `unknown`
28+
//~^^ ERROR missing code example
29+
pub fn c() {}

src/test/rustdoc-ui/lint-group.stderr

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,12 @@ LL | #![deny(rustdoc)]
2828
| ^^^^^^^
2929
= note: `#[deny(private_doc_tests)]` implied by `#[deny(rustdoc)]`
3030

31+
error: missing code example in this documentation
32+
--> $DIR/lint-group.rs:26:1
33+
|
34+
LL | /// <unknown>
35+
| ^^^^^^^^^^^^^
36+
3137
error: unresolved link to `error`
3238
--> $DIR/lint-group.rs:9:29
3339
|
@@ -42,5 +48,18 @@ LL | #![deny(rustdoc)]
4248
= note: `#[deny(broken_intra_doc_links)]` implied by `#[deny(rustdoc)]`
4349
= help: to escape `[` and `]` characters, add '\' before them like `\[` or `\]`
4450

45-
error: aborting due to 3 previous errors
51+
error: unclosed HTML tag `unknown`
52+
--> $DIR/lint-group.rs:26:5
53+
|
54+
LL | /// <unknown>
55+
| ^^^^^^^^^
56+
|
57+
note: the lint level is defined here
58+
--> $DIR/lint-group.rs:7:9
59+
|
60+
LL | #![deny(rustdoc)]
61+
| ^^^^^^^
62+
= note: `#[deny(invalid_html_tags)]` implied by `#[deny(rustdoc)]`
63+
64+
error: aborting due to 5 previous errors
4665

0 commit comments

Comments
 (0)