From 3ba0139c669868a1ece3a83a6c1891cb88b55a47 Mon Sep 17 00:00:00 2001 From: Urgau Date: Sun, 7 Apr 2024 00:46:35 +0200 Subject: [PATCH] Remove useless configs in tests Since they are never set and don't have impact on the test. Or for the cfg-panic tests are already tested with check-cfg. --- tests/ui/asm/inline-syntax.rs | 2 +- tests/ui/cfg/cfg-panic-abort.rs | 4 ---- tests/ui/cfg/cfg-panic.rs | 4 ---- tests/ui/parser/issues/issue-103381.fixed | 15 --------------- tests/ui/parser/issues/issue-103381.rs | 15 --------------- tests/ui/sanitizer/cfg-kasan.rs | 4 ++-- tests/ui/suggestions/option-to-bool.rs | 2 -- tests/ui/suggestions/option-to-bool.stderr | 2 +- 8 files changed, 4 insertions(+), 44 deletions(-) diff --git a/tests/ui/asm/inline-syntax.rs b/tests/ui/asm/inline-syntax.rs index 6da1b89ed67..4a98d37aca0 100644 --- a/tests/ui/asm/inline-syntax.rs +++ b/tests/ui/asm/inline-syntax.rs @@ -16,7 +16,7 @@ #![feature(no_core, lang_items, rustc_attrs)] #![crate_type = "rlib"] #![no_core] -#![cfg_attr(x86_64_allowed, allow(bad_asm_style))] + #[rustc_builtin_macro] macro_rules! asm { diff --git a/tests/ui/cfg/cfg-panic-abort.rs b/tests/ui/cfg/cfg-panic-abort.rs index 49adfd55c68..448fde21086 100644 --- a/tests/ui/cfg/cfg-panic-abort.rs +++ b/tests/ui/cfg/cfg-panic-abort.rs @@ -2,15 +2,11 @@ //@ compile-flags: -C panic=abort //@ no-prefer-dynamic - #[cfg(panic = "unwind")] pub fn bad() -> i32 { } #[cfg(not(panic = "abort"))] pub fn bad() -> i32 { } -#[cfg(panic = "some_imaginary_future_panic_handler")] -pub fn bad() -> i32 { } - #[cfg(panic = "abort")] pub fn main() { } diff --git a/tests/ui/cfg/cfg-panic.rs b/tests/ui/cfg/cfg-panic.rs index 0f1f539ebe3..4e3ed0cd9c2 100644 --- a/tests/ui/cfg/cfg-panic.rs +++ b/tests/ui/cfg/cfg-panic.rs @@ -2,15 +2,11 @@ //@ compile-flags: -C panic=unwind //@ needs-unwind - #[cfg(panic = "abort")] pub fn bad() -> i32 { } #[cfg(not(panic = "unwind"))] pub fn bad() -> i32 { } -#[cfg(panic = "some_imaginary_future_panic_handler")] -pub fn bad() -> i32 { } - #[cfg(panic = "unwind")] pub fn main() { } diff --git a/tests/ui/parser/issues/issue-103381.fixed b/tests/ui/parser/issues/issue-103381.fixed index 9b63bf206a0..87c308789a1 100644 --- a/tests/ui/parser/issues/issue-103381.fixed +++ b/tests/ui/parser/issues/issue-103381.fixed @@ -37,21 +37,6 @@ fn should_ok_3() { if true && if true { true } else { false } {} } -fn shoule_match_ok() { - #[cfg(feature = "full")] - { - let a = 1; - let b = 2; - if match a { - 1 if b == 1 => true, - _ => false, - } && if a > 1 { true } else { false } - { - true - } - } -} - fn should_ok_in_nested() { if true && if true { true } else { false } { true } else { false }; } diff --git a/tests/ui/parser/issues/issue-103381.rs b/tests/ui/parser/issues/issue-103381.rs index a44a7410aaf..ccbc40e5d02 100644 --- a/tests/ui/parser/issues/issue-103381.rs +++ b/tests/ui/parser/issues/issue-103381.rs @@ -37,21 +37,6 @@ fn should_ok_3() { if true && if true { true } else { false } {} } -fn shoule_match_ok() { - #[cfg(feature = "full")] - { - let a = 1; - let b = 2; - if match a { - 1 if b == 1 => true, - _ => false, - } && if a > 1 { true } else { false } - { - true - } - } -} - fn should_ok_in_nested() { if true && if true { true } else { false } { true } else { false }; } diff --git a/tests/ui/sanitizer/cfg-kasan.rs b/tests/ui/sanitizer/cfg-kasan.rs index 394bf216581..491eaf3acc1 100644 --- a/tests/ui/sanitizer/cfg-kasan.rs +++ b/tests/ui/sanitizer/cfg-kasan.rs @@ -2,7 +2,7 @@ // the `#[cfg(sanitize = "address")]` attribute is configured. //@ check-pass -//@ compile-flags: -Zsanitizer=kernel-address --cfg kernel_address +//@ compile-flags: -Zsanitizer=kernel-address //@ revisions: aarch64 riscv64imac riscv64gc x86_64 //@[aarch64] compile-flags: --target aarch64-unknown-none //@[aarch64] needs-llvm-components: aarch64 @@ -22,5 +22,5 @@ trait Sized {} const _: fn() -> () = main; -#[cfg(all(sanitize = "address", kernel_address))] +#[cfg(sanitize = "address")] fn main() {} diff --git a/tests/ui/suggestions/option-to-bool.rs b/tests/ui/suggestions/option-to-bool.rs index 2a1823b15f5..bbc5d1d71cb 100644 --- a/tests/ui/suggestions/option-to-bool.rs +++ b/tests/ui/suggestions/option-to-bool.rs @@ -1,5 +1,3 @@ -#![cfg_attr(let_chains, feature(let_chains))] - fn foo(x: Option) { if true && x {} //~^ ERROR mismatched types diff --git a/tests/ui/suggestions/option-to-bool.stderr b/tests/ui/suggestions/option-to-bool.stderr index e16d829ca7a..ab97eae6c5c 100644 --- a/tests/ui/suggestions/option-to-bool.stderr +++ b/tests/ui/suggestions/option-to-bool.stderr @@ -1,5 +1,5 @@ error[E0308]: mismatched types - --> $DIR/option-to-bool.rs:4:16 + --> $DIR/option-to-bool.rs:2:16 | LL | if true && x {} | ---- ^ expected `bool`, found `Option`