Remove crashes and fix tests

This commit is contained in:
Michael Goulet 2024-09-29 22:23:44 -04:00
parent 40465d2449
commit 6628bba060
14 changed files with 0 additions and 273 deletions

View File

@ -1,10 +0,0 @@
#![allow(incomplete_features)]
#![feature(unnamed_fields)]
#[repr(C)]
struct Foo {
_: struct {
},
}
fn main() {}

View File

@ -1,7 +0,0 @@
//@ known-bug: #117942
struct Foo {
_: union {
#[rustfmt::skip]
f: String
},
}

View File

@ -1,12 +0,0 @@
//@ known-bug: #121161
#![allow(incomplete_features)]
#![feature(unnamed_fields)]
#[derive(Eq)]
#[repr(C)]
struct Bar {
_: union {
a: u8,
},
}

View File

@ -1,6 +0,0 @@
//@ known-bug: #121263
#[repr(C)]
#[derive(Debug)]
struct L {
_: MyI32,
}

View File

@ -1,9 +0,0 @@
//@ known-bug: #121263
#[repr(C)]
#[repr(C)]
#[derive(Debug)]
struct L {
_: i32,
_: MyI32,
_: BadEnum,
}

View File

@ -1,6 +0,0 @@
//@ known-bug: #121299
#[derive(Eq)]
struct D {
_: union {
},
}

View File

@ -1,10 +0,0 @@
//@ known-bug: #121722
#[repr(C)]
struct Foo {
_: u8,
}
#[repr(C)]
struct D {
_: Foo,
}

View File

@ -1,11 +0,0 @@
//@ known-bug: #121799
struct S {
_: str
}
fn func(a: S)
{
let _x = a.f;
}
fn main() {}

View File

@ -1,9 +0,0 @@
//@ known-bug: rust-lang/rust#126969
struct S<T> {
_: union { t: T },
}
fn f(S::<&i8> { .. }: S<&i8>) {}
fn main() {}

View File

@ -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::<u8>(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::<i8>(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::<bool>(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;
}
}

View File

@ -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::<u8>(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::<i8>(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::<bool>(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;
}
}

View File

@ -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>(_: T) {}
// CHECK-LABEL: fn foo(
fn foo(foo: Foo) {
// CHECK [[a:_.*]] = (_1.0: u8);
// CHECK _.* = access::<u8>(move [[a]]) -> [return: bb1, unwind: bb5];
access(foo.a);
// CHECK [[b:_.*]] = ((_1.1: Foo::{anon_adt#0}).0: i8);
// CHECK _.* = access::<i8>(move [[b]]) -> [return: bb2, unwind: bb5];
access(foo.b);
// CHECK [[c:_.*]] = ((_1.1: Foo::{anon_adt#0}).1: bool);
// CHECK _.* = access::<bool>(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::<u8>(move [[a]]) -> [return: bb1, unwind: bb5];
access(bar.a);
// CHECK [[b:_.*]] = ((_1.1: Bar::{anon_adt#0}).0: i8);
// CHECK _.* = access::<i8>(move [[b]]) -> [return: bb2, unwind: bb5];
access(bar.b);
// CHECK [[c:_.*]] = ((_1.1: Bar::{anon_adt#0}).1: bool);
// CHECK _.* = access::<bool>(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() {}

View File

@ -23,7 +23,6 @@
#![feature(trace_macros)] #![feature(trace_macros)]
#![feature(trait_alias)] #![feature(trait_alias)]
#![feature(try_blocks)] #![feature(try_blocks)]
#![feature(unnamed_fields)]
#![feature(yeet_expr)] #![feature(yeet_expr)]
#![allow(incomplete_features)] #![allow(incomplete_features)]

View File

@ -24,7 +24,6 @@
#![feature(trace_macros)] #![feature(trace_macros)]
#![feature(trait_alias)] #![feature(trait_alias)]
#![feature(try_blocks)] #![feature(try_blocks)]
#![feature(unnamed_fields)]
#![feature(yeet_expr)] #![feature(yeet_expr)]
#![allow(incomplete_features)] #![allow(incomplete_features)]
#[prelude_import] #[prelude_import]