mirror of
https://github.com/rust-lang/rust.git
synced 2025-05-14 02:49:40 +00:00
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
@ -1201,11 +1201,12 @@ impl LangString {
|
||||
seen_rust_tags = !seen_other_tags;
|
||||
}
|
||||
LangStringToken::LangToken(x)
|
||||
if let Some(ignore) = x.strip_prefix("ignore-")
|
||||
&& enable_per_target_ignores =>
|
||||
if let Some(ignore) = x.strip_prefix("ignore-") =>
|
||||
{
|
||||
ignores.push(ignore.to_owned());
|
||||
seen_rust_tags = !seen_other_tags;
|
||||
if enable_per_target_ignores {
|
||||
ignores.push(ignore.to_owned());
|
||||
seen_rust_tags = !seen_other_tags;
|
||||
}
|
||||
}
|
||||
LangStringToken::LangToken("rust") => {
|
||||
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…
Reference in New Issue
Block a user