From fff063ee77bad38ee908577e0f40c442e0ab97a3 Mon Sep 17 00:00:00 2001 From: cyrgani Date: Fri, 30 Aug 2024 12:13:33 +0200 Subject: [PATCH] add crashtests for several old unfixed ICEs --- tests/crashes/117460.rs | 8 +++++++ tests/crashes/119095.rs | 48 +++++++++++++++++++++++++++++++++++++++++ tests/crashes/126443.rs | 15 +++++++++++++ tests/crashes/128097.rs | 6 ++++++ 4 files changed, 77 insertions(+) create mode 100644 tests/crashes/117460.rs create mode 100644 tests/crashes/119095.rs create mode 100644 tests/crashes/126443.rs create mode 100644 tests/crashes/128097.rs diff --git a/tests/crashes/117460.rs b/tests/crashes/117460.rs new file mode 100644 index 00000000000..4878a35ffe5 --- /dev/null +++ b/tests/crashes/117460.rs @@ -0,0 +1,8 @@ +//@ known-bug: #117460 +#![feature(generic_const_exprs)] + +struct Matrix { + d: D, +} + +impl Matrix {} diff --git a/tests/crashes/119095.rs b/tests/crashes/119095.rs new file mode 100644 index 00000000000..28742e0d5da --- /dev/null +++ b/tests/crashes/119095.rs @@ -0,0 +1,48 @@ +//@ known-bug: #119095 +//@ compile-flags: --edition=2021 + +fn any() -> T { + loop {} +} + +trait Acquire { + type Connection; +} + +impl Acquire for &'static () { + type Connection = (); +} + +trait Unit {} +impl Unit for () {} + +fn get_connection() -> impl Unit +where + T: Acquire, + T::Connection: Unit, +{ + any::() +} + +fn main() { + let future = async { async { get_connection::<&'static ()>() }.await }; + + future.resolve_me(); +} + +trait ResolveMe { + fn resolve_me(self); +} + +impl ResolveMe for S +where + (): CheckSend, +{ + fn resolve_me(self) {} +} + +trait CheckSend {} +impl CheckSend for () where F: Send {} + +trait NeverImplemented {} +impl CheckSend for E where E: NeverImplemented {} diff --git a/tests/crashes/126443.rs b/tests/crashes/126443.rs new file mode 100644 index 00000000000..fba779444f9 --- /dev/null +++ b/tests/crashes/126443.rs @@ -0,0 +1,15 @@ +//@ known-bug: #126443 +//@ compile-flags: -Copt-level=0 +#![feature(generic_const_exprs)] + +fn double_up() -> [(); M * 2] { + todo!() +} + +fn quadruple_up() -> [(); N * 2 * 2] { + double_up() +} + +fn main() { + quadruple_up::<0>(); +} diff --git a/tests/crashes/128097.rs b/tests/crashes/128097.rs new file mode 100644 index 00000000000..6ffca640cbd --- /dev/null +++ b/tests/crashes/128097.rs @@ -0,0 +1,6 @@ +//@ known-bug: #128097 +#![feature(explicit_tail_calls)] +fn f(x: &mut ()) { + let _y: String; + become f(x); +}