Skip to content

Commit 5d170f3

Browse files
Add warning if standalone-crate is mistyped
1 parent ada8918 commit 5d170f3

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

src/librustdoc/html/markdown.rs

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1319,6 +1319,20 @@ impl LangString {
13191319
"the code block will either not be tested if not marked as a rust \
13201320
one or the code will be wrapped inside a main function",
13211321
)),
1322+
"standalone" | "standalone_crate" => {
1323+
if let Some(extra) = extra
1324+
&& extra.sp.at_least_rust_2024()
1325+
{
1326+
Some((
1327+
"standalone-crate",
1328+
"the code block will either not be tested if not marked as \
1329+
a rust one or the code will be run as part of the merged \
1330+
doctests if compatible",
1331+
))
1332+
} else {
1333+
None
1334+
}
1335+
}
13221336
_ => None,
13231337
} {
13241338
if let Some(extra) = extra {

0 commit comments

Comments
 (0)