Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit d3cb25f

Browse files
committedDec 12, 2023
Add rustX check to codeblock attributes lint
1 parent fb32eb3 commit d3cb25f

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed
 

‎src/librustdoc/html/markdown.rs

+10
Original file line numberDiff line numberDiff line change
@@ -1284,6 +1284,16 @@ impl LangString {
12841284
LangStringToken::LangToken(x) if x.starts_with("edition") => {
12851285
data.edition = x[7..].parse::<Edition>().ok();
12861286
}
1287+
LangStringToken::LangToken(x)
1288+
if x.starts_with("rust") && x[4..].parse::<Edition>().is_ok() =>
1289+
{
1290+
if let Some(extra) = extra {
1291+
extra.error_invalid_codeblock_attr(format!(
1292+
"unknown attribute `{x}`. Did you mean `edition{}`?",
1293+
&x[4..]
1294+
));
1295+
}
1296+
}
12871297
LangStringToken::LangToken(x)
12881298
if allow_error_code_check && x.starts_with('E') && x.len() == 5 =>
12891299
{

0 commit comments

Comments
 (0)
Failed to load comments.