Skip to content

Commit

Permalink
Add rustX check to codeblock attributes lint
Browse files Browse the repository at this point in the history
  • Loading branch information
GuillaumeGomez committed Dec 12, 2023
1 parent fb32eb3 commit d3cb25f
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/librustdoc/html/markdown.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1284,6 +1284,16 @@ impl LangString {
LangStringToken::LangToken(x) if x.starts_with("edition") => {
data.edition = x[7..].parse::<Edition>().ok();
}
LangStringToken::LangToken(x)
if x.starts_with("rust") && x[4..].parse::<Edition>().is_ok() =>
{
if let Some(extra) = extra {
extra.error_invalid_codeblock_attr(format!(
"unknown attribute `{x}`. Did you mean `edition{}`?",
&x[4..]
));
}
}
LangStringToken::LangToken(x)
if allow_error_code_check && x.starts_with('E') && x.len() == 5 =>
{
Expand Down

0 comments on commit d3cb25f

Please sign in to comment.