diff --git a/tests/crashes/129150.rs b/tests/crashes/129150.rs new file mode 100644 index 00000000000..9f8c2ba1739 --- /dev/null +++ b/tests/crashes/129150.rs @@ -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 {} ); +} diff --git a/tests/crashes/129166.rs b/tests/crashes/129166.rs new file mode 100644 index 00000000000..d3635d410db --- /dev/null +++ b/tests/crashes/129166.rs @@ -0,0 +1,7 @@ +//@ known-bug: rust-lang/rust#129166 + +fn main() { + #[cfg_eval] + #[cfg] + 0 +} diff --git a/tests/crashes/129205.rs b/tests/crashes/129205.rs new file mode 100644 index 00000000000..f328fca247a --- /dev/null +++ b/tests/crashes/129205.rs @@ -0,0 +1,5 @@ +//@ known-bug: rust-lang/rust#129205 + +fn x() { + T::try_from(); +} diff --git a/tests/crashes/129209.rs b/tests/crashes/129209.rs new file mode 100644 index 00000000000..249fa41552e --- /dev/null +++ b/tests/crashes/129209.rs @@ -0,0 +1,11 @@ +//@ known-bug: rust-lang/rust#129209 + +impl< + const N: usize = { + static || { + Foo([0; X]); + } + }, + > PartialEq for True +{ +} diff --git a/tests/crashes/129214.rs b/tests/crashes/129214.rs new file mode 100644 index 00000000000..e14b9f379d6 --- /dev/null +++ b/tests/crashes/129214.rs @@ -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 { + fn map(&self, f: F) -> Vec + where + F: FnMut(&Box) -> U; +} +impl map for Vec { + fn map(&self, mut f: F) -> Vec + where + F: FnMut(&T) -> U, + { + let mut r = Vec::new(); + for i in self { + r.push(f(i)); + } + r + } +} + +fn foo>(x: T) -> Vec { + x.map(|_e| "hi".to_string()) +} + +pub fn main() { + assert_eq!(foo(vec![1]), ["hi".to_string()]); +} diff --git a/tests/crashes/129216.rs b/tests/crashes/129216.rs new file mode 100644 index 00000000000..0ad6bc5c71b --- /dev/null +++ b/tests/crashes/129216.rs @@ -0,0 +1,12 @@ +//@ known-bug: rust-lang/rust#129216 +//@ only-linux + +trait Mirror { + type Assoc; +} + +struct Foo; + +fn main() { + ::Assoc::new(); +} diff --git a/tests/crashes/129219.rs b/tests/crashes/129219.rs new file mode 100644 index 00000000000..effbfcd8b8e --- /dev/null +++ b/tests/crashes/129219.rs @@ -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: Unsize {} + +impl CastTo for U {} + +impl Cast for T {} +pub trait Cast { + fn cast(&self) -> &T + where + Self: CastTo, + { + self + } +} + +pub trait Foo {} +impl Foo for [i32; 0] {} + +fn main() { + let x: &dyn Foo = &[]; + let x = x.cast::<[i32]>(); +}