Skip to content

Commit

Permalink
Remove useless configs in tests
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
Urgau committed Apr 6, 2024
1 parent c4a97d9 commit 3ba0139
Show file tree
Hide file tree
Showing 8 changed files with 4 additions and 44 deletions.
2 changes: 1 addition & 1 deletion tests/ui/asm/inline-syntax.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
4 changes: 0 additions & 4 deletions tests/ui/cfg/cfg-panic-abort.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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() { }
4 changes: 0 additions & 4 deletions tests/ui/cfg/cfg-panic.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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() { }
15 changes: 0 additions & 15 deletions tests/ui/parser/issues/issue-103381.fixed
Original file line number Diff line number Diff line change
Expand Up @@ -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 };
}
Expand Down
15 changes: 0 additions & 15 deletions tests/ui/parser/issues/issue-103381.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 };
}
Expand Down
4 changes: 2 additions & 2 deletions tests/ui/sanitizer/cfg-kasan.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -22,5 +22,5 @@ trait Sized {}

const _: fn() -> () = main;

#[cfg(all(sanitize = "address", kernel_address))]
#[cfg(sanitize = "address")]
fn main() {}
2 changes: 0 additions & 2 deletions tests/ui/suggestions/option-to-bool.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
#![cfg_attr(let_chains, feature(let_chains))]

fn foo(x: Option<i32>) {
if true && x {}
//~^ ERROR mismatched types
Expand Down
2 changes: 1 addition & 1 deletion tests/ui/suggestions/option-to-bool.stderr
Original file line number Diff line number Diff line change
@@ -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<i32>`
Expand Down

0 comments on commit 3ba0139

Please sign in to comment.