From 6628bba06083d8b182d1f526f53a4ed6f8203042 Mon Sep 17 00:00:00 2001 From: Michael Goulet Date: Sun, 29 Sep 2024 22:23:44 -0400 Subject: [PATCH] Remove crashes and fix tests --- .../clippy/tests/ui/crashes/ice-12284.rs | 10 --- tests/crashes/117942.rs | 7 -- tests/crashes/121161.rs | 12 --- tests/crashes/121263-2.rs | 6 -- tests/crashes/121263.rs | 9 --- tests/crashes/121299.rs | 6 -- tests/crashes/121722.rs | 10 --- tests/crashes/121799.rs | 11 --- tests/crashes/126969.rs | 9 --- ...d_access.bar.SimplifyCfg-initial.after.mir | 59 --------------- ...d_access.foo.SimplifyCfg-initial.after.mir | 59 --------------- tests/mir-opt/unnamed-fields/field_access.rs | 73 ------------------- tests/ui/unpretty/expanded-exhaustive.rs | 1 - tests/ui/unpretty/expanded-exhaustive.stdout | 1 - 14 files changed, 273 deletions(-) delete mode 100644 src/tools/clippy/tests/ui/crashes/ice-12284.rs delete mode 100644 tests/crashes/117942.rs delete mode 100644 tests/crashes/121161.rs delete mode 100644 tests/crashes/121263-2.rs delete mode 100644 tests/crashes/121263.rs delete mode 100644 tests/crashes/121299.rs delete mode 100644 tests/crashes/121722.rs delete mode 100644 tests/crashes/121799.rs delete mode 100644 tests/crashes/126969.rs delete mode 100644 tests/mir-opt/unnamed-fields/field_access.bar.SimplifyCfg-initial.after.mir delete mode 100644 tests/mir-opt/unnamed-fields/field_access.foo.SimplifyCfg-initial.after.mir delete mode 100644 tests/mir-opt/unnamed-fields/field_access.rs diff --git a/src/tools/clippy/tests/ui/crashes/ice-12284.rs b/src/tools/clippy/tests/ui/crashes/ice-12284.rs deleted file mode 100644 index 8d1dbface8eba..0000000000000 --- a/src/tools/clippy/tests/ui/crashes/ice-12284.rs +++ /dev/null @@ -1,10 +0,0 @@ -#![allow(incomplete_features)] -#![feature(unnamed_fields)] - -#[repr(C)] -struct Foo { - _: struct { - }, -} - -fn main() {} diff --git a/tests/crashes/117942.rs b/tests/crashes/117942.rs deleted file mode 100644 index 6fdfc6892506e..0000000000000 --- a/tests/crashes/117942.rs +++ /dev/null @@ -1,7 +0,0 @@ -//@ known-bug: #117942 -struct Foo { - _: union { - #[rustfmt::skip] - f: String - }, -} diff --git a/tests/crashes/121161.rs b/tests/crashes/121161.rs deleted file mode 100644 index 6da6426a86d92..0000000000000 --- a/tests/crashes/121161.rs +++ /dev/null @@ -1,12 +0,0 @@ -//@ known-bug: #121161 -#![allow(incomplete_features)] -#![feature(unnamed_fields)] - - -#[derive(Eq)] -#[repr(C)] -struct Bar { - _: union { - a: u8, - }, -} diff --git a/tests/crashes/121263-2.rs b/tests/crashes/121263-2.rs deleted file mode 100644 index 2c6327a8808a5..0000000000000 --- a/tests/crashes/121263-2.rs +++ /dev/null @@ -1,6 +0,0 @@ -//@ known-bug: #121263 -#[repr(C)] -#[derive(Debug)] -struct L { - _: MyI32, -} diff --git a/tests/crashes/121263.rs b/tests/crashes/121263.rs deleted file mode 100644 index cd7583a7fafce..0000000000000 --- a/tests/crashes/121263.rs +++ /dev/null @@ -1,9 +0,0 @@ -//@ known-bug: #121263 -#[repr(C)] -#[repr(C)] -#[derive(Debug)] -struct L { - _: i32, - _: MyI32, - _: BadEnum, -} diff --git a/tests/crashes/121299.rs b/tests/crashes/121299.rs deleted file mode 100644 index be5e0c0df573e..0000000000000 --- a/tests/crashes/121299.rs +++ /dev/null @@ -1,6 +0,0 @@ -//@ known-bug: #121299 -#[derive(Eq)] -struct D { - _: union { - }, -} diff --git a/tests/crashes/121722.rs b/tests/crashes/121722.rs deleted file mode 100644 index d1b8c447bf727..0000000000000 --- a/tests/crashes/121722.rs +++ /dev/null @@ -1,10 +0,0 @@ -//@ known-bug: #121722 -#[repr(C)] -struct Foo { - _: u8, -} - -#[repr(C)] -struct D { - _: Foo, -} diff --git a/tests/crashes/121799.rs b/tests/crashes/121799.rs deleted file mode 100644 index 6035c9d9b150d..0000000000000 --- a/tests/crashes/121799.rs +++ /dev/null @@ -1,11 +0,0 @@ -//@ known-bug: #121799 -struct S { - _: str -} - -fn func(a: S) -{ - let _x = a.f; -} - -fn main() {} diff --git a/tests/crashes/126969.rs b/tests/crashes/126969.rs deleted file mode 100644 index 676563d059caf..0000000000000 --- a/tests/crashes/126969.rs +++ /dev/null @@ -1,9 +0,0 @@ -//@ known-bug: rust-lang/rust#126969 - -struct S { - _: union { t: T }, -} - -fn f(S::<&i8> { .. }: S<&i8>) {} - -fn main() {} diff --git a/tests/mir-opt/unnamed-fields/field_access.bar.SimplifyCfg-initial.after.mir b/tests/mir-opt/unnamed-fields/field_access.bar.SimplifyCfg-initial.after.mir deleted file mode 100644 index f1904e5d0f44e..0000000000000 --- a/tests/mir-opt/unnamed-fields/field_access.bar.SimplifyCfg-initial.after.mir +++ /dev/null @@ -1,59 +0,0 @@ -// MIR for `bar` after SimplifyCfg-initial - -fn bar(_1: Bar) -> () { - debug bar => _1; - let mut _0: (); - let _2: (); - let mut _3: u8; - let _4: (); - let mut _5: i8; - let _6: (); - let mut _7: bool; - let _8: (); - let mut _9: [u8; 1]; - - bb0: { - StorageLive(_2); - StorageLive(_3); - _3 = copy (_1.0: u8); - _2 = access::(move _3) -> [return: bb1, unwind: bb5]; - } - - bb1: { - StorageDead(_3); - StorageDead(_2); - StorageLive(_4); - StorageLive(_5); - _5 = copy ((_1.1: Bar::{anon_adt#0}).0: i8); - _4 = access::(move _5) -> [return: bb2, unwind: bb5]; - } - - bb2: { - StorageDead(_5); - StorageDead(_4); - StorageLive(_6); - StorageLive(_7); - _7 = copy ((_1.1: Bar::{anon_adt#0}).1: bool); - _6 = access::(move _7) -> [return: bb3, unwind: bb5]; - } - - bb3: { - StorageDead(_7); - StorageDead(_6); - StorageLive(_8); - StorageLive(_9); - _9 = copy (((_1.2: Bar::{anon_adt#1}).0: Bar::{anon_adt#1}::{anon_adt#0}).0: [u8; 1]); - _8 = access::<[u8; 1]>(move _9) -> [return: bb4, unwind: bb5]; - } - - bb4: { - StorageDead(_9); - StorageDead(_8); - _0 = const (); - return; - } - - bb5 (cleanup): { - resume; - } -} diff --git a/tests/mir-opt/unnamed-fields/field_access.foo.SimplifyCfg-initial.after.mir b/tests/mir-opt/unnamed-fields/field_access.foo.SimplifyCfg-initial.after.mir deleted file mode 100644 index c279f59001210..0000000000000 --- a/tests/mir-opt/unnamed-fields/field_access.foo.SimplifyCfg-initial.after.mir +++ /dev/null @@ -1,59 +0,0 @@ -// MIR for `foo` after SimplifyCfg-initial - -fn foo(_1: Foo) -> () { - debug foo => _1; - let mut _0: (); - let _2: (); - let mut _3: u8; - let _4: (); - let mut _5: i8; - let _6: (); - let mut _7: bool; - let _8: (); - let mut _9: [u8; 1]; - - bb0: { - StorageLive(_2); - StorageLive(_3); - _3 = copy (_1.0: u8); - _2 = access::(move _3) -> [return: bb1, unwind: bb5]; - } - - bb1: { - StorageDead(_3); - StorageDead(_2); - StorageLive(_4); - StorageLive(_5); - _5 = copy ((_1.1: Foo::{anon_adt#0}).0: i8); - _4 = access::(move _5) -> [return: bb2, unwind: bb5]; - } - - bb2: { - StorageDead(_5); - StorageDead(_4); - StorageLive(_6); - StorageLive(_7); - _7 = copy ((_1.1: Foo::{anon_adt#0}).1: bool); - _6 = access::(move _7) -> [return: bb3, unwind: bb5]; - } - - bb3: { - StorageDead(_7); - StorageDead(_6); - StorageLive(_8); - StorageLive(_9); - _9 = copy (((_1.2: Foo::{anon_adt#1}).0: Foo::{anon_adt#1}::{anon_adt#0}).0: [u8; 1]); - _8 = access::<[u8; 1]>(move _9) -> [return: bb4, unwind: bb5]; - } - - bb4: { - StorageDead(_9); - StorageDead(_8); - _0 = const (); - return; - } - - bb5 (cleanup): { - resume; - } -} diff --git a/tests/mir-opt/unnamed-fields/field_access.rs b/tests/mir-opt/unnamed-fields/field_access.rs deleted file mode 100644 index cc0ac9a342740..0000000000000 --- a/tests/mir-opt/unnamed-fields/field_access.rs +++ /dev/null @@ -1,73 +0,0 @@ -// Tests the correct handling of unnamed fields within structs and unions marked with #[repr(C)]. - -// EMIT_MIR field_access.foo.SimplifyCfg-initial.after.mir -// EMIT_MIR field_access.bar.SimplifyCfg-initial.after.mir - -#![allow(incomplete_features)] -#![feature(unnamed_fields)] - -#[repr(C)] -struct Foo { - a: u8, - _: struct { - b: i8, - c: bool, - }, - _: struct { - _: struct { - d: [u8; 1], - } - }, -} - -#[repr(C)] -union Bar { - a: u8, - _: union { - b: i8, - c: bool, - }, - _: union { - _: union { - d: [u8; 1], - } - }, -} - -fn access(_: T) {} - -// CHECK-LABEL: fn foo( -fn foo(foo: Foo) { - // CHECK [[a:_.*]] = (_1.0: u8); - // CHECK _.* = access::(move [[a]]) -> [return: bb1, unwind: bb5]; - access(foo.a); - // CHECK [[b:_.*]] = ((_1.1: Foo::{anon_adt#0}).0: i8); - // CHECK _.* = access::(move [[b]]) -> [return: bb2, unwind: bb5]; - access(foo.b); - // CHECK [[c:_.*]] = ((_1.1: Foo::{anon_adt#0}).1: bool); - // CHECK _.* = access::(move [[c]]) -> [return: bb3, unwind: bb5]; - access(foo.c); - // CHECK [[d:_.*]] = (((_1.2: Foo::{anon_adt#1}).0: Foo::{anon_adt#1}::{anon_adt#0}).0: [u8; 1]); - // CHECK _.* = access::<[u8; 1]>(move [[d]]) -> [return: bb4, unwind: bb5]; - access(foo.d); -} - -// CHECK-LABEL: fn bar( -fn bar(bar: Bar) { - unsafe { - // CHECK [[a:_.*]] = (_1.0: u8); - // CHECK _.* = access::(move [[a]]) -> [return: bb1, unwind: bb5]; - access(bar.a); - // CHECK [[b:_.*]] = ((_1.1: Bar::{anon_adt#0}).0: i8); - // CHECK _.* = access::(move [[b]]) -> [return: bb2, unwind: bb5]; - access(bar.b); - // CHECK [[c:_.*]] = ((_1.1: Bar::{anon_adt#0}).1: bool); - // CHECK _.* = access::(move [[c]]) -> [return: bb3, unwind: bb5]; - access(bar.c); - // CHECK [[d:_.*]] = (((_1.2: Bar::{anon_adt#1}).0: Bar::{anon_adt#1}::{anon_adt#0}).0: [u8; 1]); - // CHECK _.* = access::<[u8; 1]>(move [[d]]) -> [return: bb4, unwind: bb5]; - access(bar.d); - } -} - -fn main() {} diff --git a/tests/ui/unpretty/expanded-exhaustive.rs b/tests/ui/unpretty/expanded-exhaustive.rs index b287e48e476e3..799e8071d028a 100644 --- a/tests/ui/unpretty/expanded-exhaustive.rs +++ b/tests/ui/unpretty/expanded-exhaustive.rs @@ -23,7 +23,6 @@ #![feature(trace_macros)] #![feature(trait_alias)] #![feature(try_blocks)] -#![feature(unnamed_fields)] #![feature(yeet_expr)] #![allow(incomplete_features)] diff --git a/tests/ui/unpretty/expanded-exhaustive.stdout b/tests/ui/unpretty/expanded-exhaustive.stdout index f8d09650d925e..d8384951e12f0 100644 --- a/tests/ui/unpretty/expanded-exhaustive.stdout +++ b/tests/ui/unpretty/expanded-exhaustive.stdout @@ -24,7 +24,6 @@ #![feature(trace_macros)] #![feature(trait_alias)] #![feature(try_blocks)] -#![feature(unnamed_fields)] #![feature(yeet_expr)] #![allow(incomplete_features)] #[prelude_import]