crashes: more tests

This commit is contained in:
Matthias Krüger 2024-08-18 12:50:01 +02:00
parent 6de928dce9
commit 5fe70afc8c
7 changed files with 98 additions and 0 deletions

7
tests/crashes/129150.rs Normal file
View File

@ -0,0 +1,7 @@
//@ known-bug: rust-lang/rust#129150
//@ only-x86_64
use std::arch::x86_64::_mm_blend_ps;
pub fn main() {
_mm_blend_ps(1, 2, &const {} );
}

7
tests/crashes/129166.rs Normal file
View File

@ -0,0 +1,7 @@
//@ known-bug: rust-lang/rust#129166
fn main() {
#[cfg_eval]
#[cfg]
0
}

5
tests/crashes/129205.rs Normal file
View File

@ -0,0 +1,5 @@
//@ known-bug: rust-lang/rust#129205
fn x<T: Copy>() {
T::try_from();
}

11
tests/crashes/129209.rs Normal file
View File

@ -0,0 +1,11 @@
//@ known-bug: rust-lang/rust#129209
impl<
const N: usize = {
static || {
Foo([0; X]);
}
},
> PartialEq for True
{
}

30
tests/crashes/129214.rs Normal file
View File

@ -0,0 +1,30 @@
//@ known-bug: rust-lang/rust#129214
//@ compile-flags: -Zvalidate-mir -Copt-level=3 --crate-type=lib
trait to_str {}
trait map<T> {
fn map<U, F>(&self, f: F) -> Vec<U>
where
F: FnMut(&Box<usize>) -> U;
}
impl<T> map<T> for Vec<T> {
fn map<U, F>(&self, mut f: F) -> Vec<U>
where
F: FnMut(&T) -> U,
{
let mut r = Vec::new();
for i in self {
r.push(f(i));
}
r
}
}
fn foo<U, T: map<U>>(x: T) -> Vec<String> {
x.map(|_e| "hi".to_string())
}
pub fn main() {
assert_eq!(foo(vec![1]), ["hi".to_string()]);
}

12
tests/crashes/129216.rs Normal file
View File

@ -0,0 +1,12 @@
//@ known-bug: rust-lang/rust#129216
//@ only-linux
trait Mirror {
type Assoc;
}
struct Foo;
fn main() {
<Foo as Mirror>::Assoc::new();
}

26
tests/crashes/129219.rs Normal file
View File

@ -0,0 +1,26 @@
//@ known-bug: rust-lang/rust#129219
//@ compile-flags: -Zmir-opt-level=5 -Zvalidate-mir --edition=2018
use core::marker::Unsize;
pub trait CastTo<T: ?Sized>: Unsize<T> {}
impl<T: ?Sized, U: ?Sized> CastTo<T> for U {}
impl<T: ?Sized> Cast for T {}
pub trait Cast {
fn cast<T: ?Sized>(&self) -> &T
where
Self: CastTo<T>,
{
self
}
}
pub trait Foo {}
impl Foo for [i32; 0] {}
fn main() {
let x: &dyn Foo = &[];
let x = x.cast::<[i32]>();
}