Add warning if standalone-crate is mistyped

This commit is contained in:
Guillaume Gomez 2024-09-27 21:39:52 +02:00
parent 35f24d0d14
commit 0956f69caf

View File

@ -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 {