Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

crashes: more tests #129228

Merged
merged 1 commit into from
Aug 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions tests/crashes/129150.rs
Original file line number Diff line number Diff line change
@@ -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 changes: 7 additions & 0 deletions tests/crashes/129166.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
//@ known-bug: rust-lang/rust#129166

fn main() {
#[cfg_eval]
#[cfg]
0
}
5 changes: 5 additions & 0 deletions tests/crashes/129205.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
//@ known-bug: rust-lang/rust#129205

fn x<T: Copy>() {
T::try_from();
}
11 changes: 11 additions & 0 deletions tests/crashes/129209.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
//@ known-bug: rust-lang/rust#129209

impl<
const N: usize = {
static || {
Foo([0; X]);
}
},
> PartialEq for True
{
}
30 changes: 30 additions & 0 deletions tests/crashes/129214.rs
Original file line number Diff line number Diff line change
@@ -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 changes: 12 additions & 0 deletions tests/crashes/129216.rs
Original file line number Diff line number Diff line change
@@ -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 changes: 26 additions & 0 deletions tests/crashes/129219.rs
Original file line number Diff line number Diff line change
@@ -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]>();
}
Loading