Skip to content

Commit c3ae826

Browse files
Add test for suggestion in case a "ignore" doc block has invalid rust code inside
1 parent 5bf5b12 commit c3ae826

File tree

2 files changed

+24
-0
lines changed

2 files changed

+24
-0
lines changed
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
// check-pass
2+
3+
/// ```ignore (to-prevent-tidy-error)
4+
/// let heart = '❤️';
5+
/// ```
6+
//~^^^ WARN
7+
pub struct X;
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
warning: could not parse code block as Rust code
2+
--> $DIR/ignore-block-help.rs:3:5
3+
|
4+
LL | /// ```ignore (to-prevent-tidy-error)
5+
| _____^
6+
LL | | /// let heart = '❤️';
7+
LL | | /// ```
8+
| |_______^
9+
|
10+
= note: error from rustc: character literal may only contain one codepoint
11+
help: `ignore` code blocks require valid Rust code for syntax highlighting. Mark blocks that do not contain Rust code as text
12+
|
13+
LL | /// ```text,ignore (to-prevent-tidy-error)
14+
| ^^^^^^^^
15+
16+
warning: 1 warning emitted
17+

0 commit comments

Comments
 (0)