Skip to content

Commit

Permalink
Add warning if standalone-crate is mistyped
Browse files Browse the repository at this point in the history
  • Loading branch information
GuillaumeGomez committed Sep 28, 2024
1 parent 35f24d0 commit 0956f69
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions src/librustdoc/html/markdown.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1319,6 +1319,20 @@ impl LangString {
"the code block will either not be tested if not marked as a rust \
one or the code will be wrapped inside a main function",
)),
"standalone" | "standalone_crate" => {
if let Some(extra) = extra
&& extra.sp.at_least_rust_2024()
{
Some((
"standalone-crate",
"the code block will either not be tested if not marked as \
a rust one or the code will be run as part of the merged \
doctests if compatible",
))
} else {
None
}
}
_ => None,
} {
if let Some(extra) = extra {
Expand Down

0 comments on commit 0956f69

Please sign in to comment.