From eca5359b832f073e16616fce0080701e7e65d1e0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matthias=20Kr=C3=BCger?= Date: Sun, 20 Oct 2024 10:05:39 +0200 Subject: [PATCH] add latest crash tests --- tests/crashes/131637.rs | 7 +++++++ tests/crashes/131648.rs | 7 +++++++ tests/crashes/131668.rs | 12 ++++++++++++ tests/crashes/131758.rs | 11 +++++++++++ tests/crashes/131762.rs | 9 +++++++++ tests/crashes/131787.rs | 5 +++++ tests/crashes/131886.rs | 12 ++++++++++++ tests/crashes/131915.rs | 13 +++++++++++++ 8 files changed, 76 insertions(+) create mode 100644 tests/crashes/131637.rs create mode 100644 tests/crashes/131648.rs create mode 100644 tests/crashes/131668.rs create mode 100644 tests/crashes/131758.rs create mode 100644 tests/crashes/131762.rs create mode 100644 tests/crashes/131787.rs create mode 100644 tests/crashes/131886.rs create mode 100644 tests/crashes/131915.rs diff --git a/tests/crashes/131637.rs b/tests/crashes/131637.rs new file mode 100644 index 00000000000..7d328384a74 --- /dev/null +++ b/tests/crashes/131637.rs @@ -0,0 +1,7 @@ +//@ known-bug: #121637 +#![feature(non_lifetime_binders)] +trait Trait { + type Type; + + fn method(&self) -> impl for Trait>; +} diff --git a/tests/crashes/131648.rs b/tests/crashes/131648.rs new file mode 100644 index 00000000000..68046ce2a1f --- /dev/null +++ b/tests/crashes/131648.rs @@ -0,0 +1,7 @@ +//@ known-bug: #131648 +#![feature(return_type_notation)] + +trait IntFactory { + fn stream(self) -> impl IntFactory; +} +fn main() {} diff --git a/tests/crashes/131668.rs b/tests/crashes/131668.rs new file mode 100644 index 00000000000..90aa4494425 --- /dev/null +++ b/tests/crashes/131668.rs @@ -0,0 +1,12 @@ +//@ known-bug: #131668 + +#![feature(generic_associated_types_extended)] +trait B { + type Y; +} + +struct Erase(T); + +fn make_static() { + Erase:: B<&'c ()>>(()); +} diff --git a/tests/crashes/131758.rs b/tests/crashes/131758.rs new file mode 100644 index 00000000000..942c5fd7a50 --- /dev/null +++ b/tests/crashes/131758.rs @@ -0,0 +1,11 @@ +//@ known-bug: #131758 +#![feature(unboxed_closures)] +trait Foo {} + +impl> Foo for T {} + +fn baz(_: T) {} + +fn main() { + baz(|x| ()); +} diff --git a/tests/crashes/131762.rs b/tests/crashes/131762.rs new file mode 100644 index 00000000000..85cb9c8f20a --- /dev/null +++ b/tests/crashes/131762.rs @@ -0,0 +1,9 @@ +//@ known-bug: #131762 +// ignore-tidy-linelength + +#![feature(generic_assert)] +struct FloatWrapper(f64); + +fn main() { + assert!((0.0 / 0.0 >= 0.0) == (FloatWrapper(0.0 / 0.0) >= FloatWrapper(size_of::, size_of::, size_of:: as fn() -> usize))) +} diff --git a/tests/crashes/131787.rs b/tests/crashes/131787.rs new file mode 100644 index 00000000000..5c24ff8c143 --- /dev/null +++ b/tests/crashes/131787.rs @@ -0,0 +1,5 @@ +//@ known-bug: #131787 +#[track_caller] +static no_mangle: u32 = { + unimplemented!(); +}; diff --git a/tests/crashes/131886.rs b/tests/crashes/131886.rs new file mode 100644 index 00000000000..c31c2d6aa8b --- /dev/null +++ b/tests/crashes/131886.rs @@ -0,0 +1,12 @@ +//@ known-bug: #131886 +//@ compile-flags: -Zvalidate-mir --crate-type=lib +#![feature(trait_upcasting, type_alias_impl_trait)] + +type Tait = impl Sized; + +trait Foo<'a>: Bar<'a, 'a, Tait> {} +trait Bar<'a, 'b, T> {} + +fn test_correct3<'a>(x: &dyn Foo<'a>, _: Tait) { + let _ = x as &dyn Bar<'_, '_, ()>; +} diff --git a/tests/crashes/131915.rs b/tests/crashes/131915.rs new file mode 100644 index 00000000000..58d45adcb3b --- /dev/null +++ b/tests/crashes/131915.rs @@ -0,0 +1,13 @@ +//@ known-bug: #131915 + +macro_rules! y { + ( $($matcher:tt)*) => { + x + }; +} + +const _: A< + { + y! { test.tou8 } + }, +>;