Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 14 additions & 13 deletions src/librustdoc/html/markdown.rs
Original file line number Diff line number Diff line change
Expand Up @@ -387,7 +387,7 @@ impl LangString {
should_fail: false,
no_run: false,
ignore: false,
rust: false,
rust: true, // NB This used to be `notrust = false`
test_harness: false,
}
}
Expand All @@ -413,7 +413,7 @@ impl LangString {
}
}

data.rust |= !seen_other_tags || seen_rust_tags;
data.rust &= !seen_other_tags || seen_rust_tags;

data
}
Expand Down Expand Up @@ -465,17 +465,18 @@ mod tests {
})
}

t("", false,false,false,true,false);
t("rust", false,false,false,true,false);
t("sh", false,false,false,false,false);
t("ignore", false,false,true,true,false);
t("should_fail", true,false,false,true,false);
t("no_run", false,true,false,true,false);
t("test_harness", false,false,false,true,true);
t("{.no_run .example}", false,true,false,true,false);
t("{.sh .should_fail}", true,false,false,true,false);
t("{.example .rust}", false,false,false,true,false);
t("{.test_harness .rust}", false,false,false,true,true);
// marker | should_fail | no_run | ignore | rust | test_harness
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

\o/

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I had started a macro t! where you would do t!("sh", rust == false) and t!("", rust == true, no_run == false) or whatever. But the table at least makes things easier to see.

t("", false, false, false, true, false);
t("rust", false, false, false, true, false);
t("sh", false, false, false, false, false);
t("ignore", false, false, true, true, false);
t("should_fail", true, false, false, true, false);
t("no_run", false, true, false, true, false);
t("test_harness", false, false, false, true, true);
t("{.no_run .example}", false, true, false, true, false);
t("{.sh .should_fail}", true, false, false, true, false);
t("{.example .rust}", false, false, false, true, false);
t("{.test_harness .rust}", false, false, false, true, true);
}

#[test]
Expand Down