mirror of https://github.com/rust-lang/rust.git
Auto merge of #127344 - matthiaskrgr:morecrashes, r=jieyouxu
crashes: add latest r? `@jieyouxu` `@bors` rollup=iffy
This commit is contained in:
commit
d2e6cf7fa7
|
@ -0,0 +1,17 @@
|
|||
//@ known-bug: rust-lang/rust#126896
|
||||
//@ compile-flags: -Zpolymorphize=on -Zinline-mir=yes
|
||||
|
||||
#![feature(type_alias_impl_trait)]
|
||||
type Two<'a, 'b> = impl std::fmt::Debug;
|
||||
|
||||
fn set(x: &mut isize) -> isize {
|
||||
*x
|
||||
}
|
||||
|
||||
fn d(x: Two) {
|
||||
let c1 = || set(x);
|
||||
c1;
|
||||
}
|
||||
|
||||
fn main() {
|
||||
}
|
|
@ -0,0 +1,21 @@
|
|||
//@ known-bug: rust-lang/rust#126939
|
||||
|
||||
struct MySlice<T: Copy>(bool, T);
|
||||
type MySliceBool = MySlice<[bool]>;
|
||||
|
||||
use std::mem;
|
||||
|
||||
struct P2<T> {
|
||||
a: T,
|
||||
b: MySliceBool,
|
||||
}
|
||||
|
||||
macro_rules! check {
|
||||
($t:ty, $align:expr) => ({
|
||||
assert_eq!(mem::align_of::<$t>(), $align);
|
||||
});
|
||||
}
|
||||
|
||||
pub fn main() {
|
||||
check!(P2<u8>, 1);
|
||||
}
|
|
@ -0,0 +1,11 @@
|
|||
//@ known-bug: rust-lang/rust#126942
|
||||
struct Thing;
|
||||
|
||||
pub trait Every {
|
||||
type Assoc;
|
||||
}
|
||||
impl<T: ?Sized> Every for Thing {
|
||||
type Assoc = T;
|
||||
}
|
||||
|
||||
static I: <Thing as Every>::Assoc = 3;
|
|
@ -0,0 +1,38 @@
|
|||
//@ known-bug: rust-lang/rust#126944
|
||||
// Step 1: Create two names for a single type: `Thing` and `AlsoThing`
|
||||
|
||||
struct Thing;
|
||||
struct Dummy;
|
||||
pub trait DummyTrait {
|
||||
type DummyType;
|
||||
}
|
||||
impl DummyTrait for Dummy {
|
||||
type DummyType = Thing;
|
||||
}
|
||||
type AlsoThing = <Dummy as DummyTrait>::DummyType;
|
||||
|
||||
// Step 2: Create names for a single trait object type: `TraitObject` and `AlsoTraitObject`
|
||||
|
||||
pub trait SomeTrait {
|
||||
type Item;
|
||||
}
|
||||
type TraitObject = dyn SomeTrait<Item = AlsoThing>;
|
||||
type AlsoTraitObject = dyn SomeTrait<Item = Thing>;
|
||||
|
||||
// Step 3: Force the compiler to check whether the two names are the same type
|
||||
|
||||
pub trait Supertrait {
|
||||
type Foo;
|
||||
}
|
||||
pub trait Subtrait: Supertrait<Foo = TraitObject> {}
|
||||
|
||||
pub trait HasOutput<A: ?Sized> {
|
||||
type Output;
|
||||
}
|
||||
|
||||
fn foo<F>() -> F::Output
|
||||
where
|
||||
F: HasOutput<dyn Subtrait<Foo = AlsoTraitObject>>,
|
||||
{
|
||||
todo!()
|
||||
}
|
|
@ -0,0 +1,29 @@
|
|||
//@ known-bug: rust-lang/rust#126966
|
||||
mod assert {
|
||||
use std::mem::{Assume, BikeshedIntrinsicFrom};
|
||||
|
||||
pub fn is_transmutable<Src, Dst>()
|
||||
where
|
||||
Dst: BikeshedIntrinsicFrom<Src>,
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
#[repr(u32)]
|
||||
enum Ox00 {
|
||||
V = 0x00,
|
||||
}
|
||||
|
||||
#[repr(C, packed(2))]
|
||||
enum OxFF {
|
||||
V = 0xFF,
|
||||
}
|
||||
|
||||
fn test() {
|
||||
union Superset {
|
||||
a: Ox00,
|
||||
b: OxFF,
|
||||
}
|
||||
|
||||
assert::is_transmutable::<Superset, Subset>();
|
||||
}
|
|
@ -0,0 +1,9 @@
|
|||
//@ known-bug: rust-lang/rust#126969
|
||||
|
||||
struct S<T> {
|
||||
_: union { t: T },
|
||||
}
|
||||
|
||||
fn f(S::<&i8> { .. }: S<&i8>) {}
|
||||
|
||||
fn main() {}
|
|
@ -0,0 +1,18 @@
|
|||
//@ known-bug: rust-lang/rust#126982
|
||||
|
||||
#![feature(coerce_unsized)]
|
||||
use std::ops::CoerceUnsized;
|
||||
|
||||
struct Foo<T: ?Sized> {
|
||||
a: T,
|
||||
}
|
||||
|
||||
impl<T, U> CoerceUnsized<U> for Foo<T> {}
|
||||
|
||||
union U {
|
||||
a: usize,
|
||||
}
|
||||
|
||||
const C: U = Foo { a: 10 };
|
||||
|
||||
fn main() {}
|
|
@ -0,0 +1,3 @@
|
|||
//@ known-bug: rust-lang/rust#127222
|
||||
#[marker]
|
||||
trait Foo = PartialEq<i32> + Send;
|
|
@ -0,0 +1,17 @@
|
|||
//@ known-bug: rust-lang/rust#127266
|
||||
#![feature(const_mut_refs)]
|
||||
#![feature(const_refs_to_static)]
|
||||
|
||||
struct Meh {
|
||||
x: &'static dyn UnsafeCell,
|
||||
}
|
||||
|
||||
const MUH: Meh = Meh {
|
||||
x: &mut *(READONLY as *mut _),
|
||||
};
|
||||
|
||||
static READONLY: i32 = 0;
|
||||
|
||||
trait UnsafeCell<'a> {}
|
||||
|
||||
pub fn main() {}
|
|
@ -0,0 +1,12 @@
|
|||
//@ known-bug: rust-lang/rust#127299
|
||||
trait Qux {
|
||||
fn bar() -> i32;
|
||||
}
|
||||
|
||||
pub struct Lint {
|
||||
pub desc: &'static Qux,
|
||||
}
|
||||
|
||||
static FOO: &Lint = &Lint { desc: "desc" };
|
||||
|
||||
fn main() {}
|
|
@ -0,0 +1,20 @@
|
|||
//@ known-bug: rust-lang/rust #127304
|
||||
#![feature(adt_const_params)]
|
||||
|
||||
trait Trait<T> {}
|
||||
impl Trait<u16> for () {}
|
||||
|
||||
struct MyStr(str);
|
||||
impl std::marker::ConstParamTy for MyStr {}
|
||||
|
||||
fn function_with_my_str<const S: &'static MyStr>() -> &'static MyStr {
|
||||
S
|
||||
}
|
||||
|
||||
impl MyStr {
|
||||
const fn new(s: &Trait str) -> &'static MyStr {}
|
||||
}
|
||||
|
||||
pub fn main() {
|
||||
let f = function_with_my_str::<{ MyStr::new("hello") }>();
|
||||
}
|
|
@ -0,0 +1,9 @@
|
|||
//@ known-bug: rust-lang/rust #127332
|
||||
|
||||
async fn fun() {
|
||||
enum Foo {
|
||||
A { x: u32 },
|
||||
}
|
||||
let orig = Foo::A { x: 5 };
|
||||
Foo::A { x: 6, ..orig };
|
||||
}
|
Loading…
Reference in New Issue