diff --git a/tests/crashes/129262.rs b/tests/crashes/129262.rs new file mode 100644 index 00000000000..c430af35988 --- /dev/null +++ b/tests/crashes/129262.rs @@ -0,0 +1,21 @@ +//@ known-bug: rust-lang/rust#129262 +//@ compile-flags: -Zvalidate-mir --edition=2018 --crate-type=lib -Copt-level=3 + +#![feature(async_closure)] + +fn main() {} + +fn needs_fn_mut(mut x: impl FnMut() -> T) { + x(); +} + +fn hello(x: Ty) { + needs_fn_mut(async || { + x.hello(); + }); +} + +struct Ty; +impl Ty { + fn hello(self) {} +} diff --git a/tests/crashes/129850.rs b/tests/crashes/129850.rs new file mode 100644 index 00000000000..9c04805587a --- /dev/null +++ b/tests/crashes/129850.rs @@ -0,0 +1,9 @@ +//@ known-bug: rust-lang/rust#129850 + +pub trait Foo2 { + fn bar<'a: 'a>(&'a mut self) -> impl Sized + use<'static>; +} + +impl Foo2 for () { + fn bar<'a: 'a>(&'a mut self) -> impl Sized + 'a {} +} diff --git a/tests/crashes/130104.rs b/tests/crashes/130104.rs new file mode 100644 index 00000000000..0ffc21ad360 --- /dev/null +++ b/tests/crashes/130104.rs @@ -0,0 +1,6 @@ +//@ known-bug: rust-lang/rust#130104 + +fn main() { + let non_secure_function = + core::mem::transmute:: _, extern "C-cmse-nonsecure-call" fn() -> _>; +} diff --git a/tests/crashes/130310.rs b/tests/crashes/130310.rs new file mode 100644 index 00000000000..d59dd39983c --- /dev/null +++ b/tests/crashes/130310.rs @@ -0,0 +1,15 @@ +//@ known-bug: rust-lang/rust#130310 + +use std::marker::PhantomData; + +#[repr(C)] +struct A { + a: *const A>, + p: PhantomData, +} + +extern "C" { + fn f(a: *const A<()>); +} + +fn main() {} diff --git a/tests/crashes/130346.rs b/tests/crashes/130346.rs new file mode 100644 index 00000000000..ee25f0fcc5b --- /dev/null +++ b/tests/crashes/130346.rs @@ -0,0 +1,10 @@ +//@ known-bug: rust-lang/rust#130346 + +#![feature(non_lifetime_binders)] +#![allow(unused)] + +trait A: Iterator {} + +fn demo(x: &mut impl for A) { + let _: Option = x.next(); // Removing this line stops the ICE +} diff --git a/tests/crashes/130372-1.rs b/tests/crashes/130372-1.rs new file mode 100644 index 00000000000..5d58c14e7ab --- /dev/null +++ b/tests/crashes/130372-1.rs @@ -0,0 +1,9 @@ +//@ known-bug: rust-lang/rust#130372 + +pub fn variadic_fn(n: usize, mut args: ...) {} + +reuse variadic_fn; + +fn main() { + variadic_fn(); +} diff --git a/tests/crashes/130372-2.rs b/tests/crashes/130372-2.rs new file mode 100644 index 00000000000..46404191e32 --- /dev/null +++ b/tests/crashes/130372-2.rs @@ -0,0 +1,11 @@ +//@ known-bug: rust-lang/rust#130372 + +pub fn test_va_copy(_: u64, mut ap: ...) {} + +pub fn main() { + unsafe { + test_va_copy(); + + call(x); + } +} diff --git a/tests/crashes/130372-3.rs b/tests/crashes/130372-3.rs new file mode 100644 index 00000000000..6e1c57437c8 --- /dev/null +++ b/tests/crashes/130372-3.rs @@ -0,0 +1,7 @@ +//@ known-bug: rust-lang/rust#130372 + +fn bar() -> impl Fn() { + wrap() +} + +fn wrap(...: impl ...) -> impl Fn() {} diff --git a/tests/crashes/130399.rs b/tests/crashes/130399.rs new file mode 100644 index 00000000000..2248c8c0124 --- /dev/null +++ b/tests/crashes/130399.rs @@ -0,0 +1,5 @@ +//@ known-bug: rust-lang/rust#130399 + +fn elided(main: &()) -> impl Sized + use
{} + +fn main() {}