Rollup merge of #138877 - TaKO8Ki:enable-per-target-ignores-for-doctests, r=notriddle
Ignore doctests only in specified targets Quick fix for #138863 FIxes #138863 cc `@yotamofek` `@notriddle`
This commit is contained in:
commit
fc8fc051b6
3 changed files with 25 additions and 4 deletions
|
@ -1201,11 +1201,12 @@ impl LangString {
|
||||||
seen_rust_tags = !seen_other_tags;
|
seen_rust_tags = !seen_other_tags;
|
||||||
}
|
}
|
||||||
LangStringToken::LangToken(x)
|
LangStringToken::LangToken(x)
|
||||||
if let Some(ignore) = x.strip_prefix("ignore-")
|
if let Some(ignore) = x.strip_prefix("ignore-") =>
|
||||||
&& enable_per_target_ignores =>
|
|
||||||
{
|
{
|
||||||
ignores.push(ignore.to_owned());
|
if enable_per_target_ignores {
|
||||||
seen_rust_tags = !seen_other_tags;
|
ignores.push(ignore.to_owned());
|
||||||
|
seen_rust_tags = !seen_other_tags;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
LangStringToken::LangToken("rust") => {
|
LangStringToken::LangToken("rust") => {
|
||||||
data.rust = true;
|
data.rust = true;
|
||||||
|
|
14
tests/rustdoc-ui/doctest/per-target-ignores.rs
Normal file
14
tests/rustdoc-ui/doctest/per-target-ignores.rs
Normal file
|
@ -0,0 +1,14 @@
|
||||||
|
//@ only-aarch64
|
||||||
|
//@ compile-flags:--test
|
||||||
|
//@ normalize-stdout: "tests/rustdoc-ui/doctest" -> "$$DIR"
|
||||||
|
//@ normalize-stdout: "finished in \d+\.\d+s" -> "finished in $$TIME"
|
||||||
|
//@ check-pass
|
||||||
|
|
||||||
|
///```ignore-x86_64
|
||||||
|
/// assert!(cfg!(not(target_arch = "x86_64")));
|
||||||
|
///```
|
||||||
|
pub fn foo() -> u8 {
|
||||||
|
4
|
||||||
|
}
|
||||||
|
|
||||||
|
fn main() {}
|
6
tests/rustdoc-ui/doctest/per-target-ignores.stdout
Normal file
6
tests/rustdoc-ui/doctest/per-target-ignores.stdout
Normal file
|
@ -0,0 +1,6 @@
|
||||||
|
|
||||||
|
running 1 test
|
||||||
|
test $DIR/per-target-ignores.rs - foo (line 7) ... ok
|
||||||
|
|
||||||
|
test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in $TIME
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue