Skip to content

Commit 804be74

Browse files
committed
Auto merge of rust-lang#129228 - matthiaskrgr:oopsie, r=jieyouxu
crashes: more tests r? `@jieyouxu`
2 parents d0293c6 + 5fe70af commit 804be74

File tree

7 files changed

+98
-0
lines changed

7 files changed

+98
-0
lines changed

tests/crashes/129150.rs

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
//@ known-bug: rust-lang/rust#129150
2+
//@ only-x86_64
3+
use std::arch::x86_64::_mm_blend_ps;
4+
5+
pub fn main() {
6+
_mm_blend_ps(1, 2, &const {} );
7+
}

tests/crashes/129166.rs

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
//@ known-bug: rust-lang/rust#129166
2+
3+
fn main() {
4+
#[cfg_eval]
5+
#[cfg]
6+
0
7+
}

tests/crashes/129205.rs

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
//@ known-bug: rust-lang/rust#129205
2+
3+
fn x<T: Copy>() {
4+
T::try_from();
5+
}

tests/crashes/129209.rs

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
//@ known-bug: rust-lang/rust#129209
2+
3+
impl<
4+
const N: usize = {
5+
static || {
6+
Foo([0; X]);
7+
}
8+
},
9+
> PartialEq for True
10+
{
11+
}

tests/crashes/129214.rs

+30
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
//@ known-bug: rust-lang/rust#129214
2+
//@ compile-flags: -Zvalidate-mir -Copt-level=3 --crate-type=lib
3+
4+
trait to_str {}
5+
6+
trait map<T> {
7+
fn map<U, F>(&self, f: F) -> Vec<U>
8+
where
9+
F: FnMut(&Box<usize>) -> U;
10+
}
11+
impl<T> map<T> for Vec<T> {
12+
fn map<U, F>(&self, mut f: F) -> Vec<U>
13+
where
14+
F: FnMut(&T) -> U,
15+
{
16+
let mut r = Vec::new();
17+
for i in self {
18+
r.push(f(i));
19+
}
20+
r
21+
}
22+
}
23+
24+
fn foo<U, T: map<U>>(x: T) -> Vec<String> {
25+
x.map(|_e| "hi".to_string())
26+
}
27+
28+
pub fn main() {
29+
assert_eq!(foo(vec![1]), ["hi".to_string()]);
30+
}

tests/crashes/129216.rs

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
//@ known-bug: rust-lang/rust#129216
2+
//@ only-linux
3+
4+
trait Mirror {
5+
type Assoc;
6+
}
7+
8+
struct Foo;
9+
10+
fn main() {
11+
<Foo as Mirror>::Assoc::new();
12+
}

tests/crashes/129219.rs

+26
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
//@ known-bug: rust-lang/rust#129219
2+
//@ compile-flags: -Zmir-opt-level=5 -Zvalidate-mir --edition=2018
3+
4+
use core::marker::Unsize;
5+
6+
pub trait CastTo<T: ?Sized>: Unsize<T> {}
7+
8+
impl<T: ?Sized, U: ?Sized> CastTo<T> for U {}
9+
10+
impl<T: ?Sized> Cast for T {}
11+
pub trait Cast {
12+
fn cast<T: ?Sized>(&self) -> &T
13+
where
14+
Self: CastTo<T>,
15+
{
16+
self
17+
}
18+
}
19+
20+
pub trait Foo {}
21+
impl Foo for [i32; 0] {}
22+
23+
fn main() {
24+
let x: &dyn Foo = &[];
25+
let x = x.cast::<[i32]>();
26+
}

0 commit comments

Comments
 (0)