add more crash tests

This commit is contained in:
Matthias Krüger 2025-01-12 10:11:29 +01:00
parent 12445e0b2c
commit ee4cca8702
5 changed files with 56 additions and 0 deletions

24
tests/crashes/135122.rs Normal file
View file

@ -0,0 +1,24 @@
//@ known-bug: #135122
trait Add {
type Output;
fn add(_: (), _: Self::Output) {}
}
trait IsSame<Lhs> {
type Assoc;
}
trait Data {
type Elem;
}
impl<B> IsSame<i16> for f32 where f32: IsSame<B, Assoc = B> {}
impl<A> Add for i64
where
f32: IsSame<A>,
i8: Data<Elem = A>,
{
type Output = <f32 as IsSame<A>>::Assoc;
fn add(_: Data, _: Self::Output) {}
}

9
tests/crashes/135124.rs Normal file
View file

@ -0,0 +1,9 @@
//@ known-bug: #135124
trait A {
fn y(&self)
{
fn call() -> impl Sized {}
self.fold(call());
}
fn fold(&self, &self._) {}
}

10
tests/crashes/135128.rs Normal file
View file

@ -0,0 +1,10 @@
//@ known-bug: #135128
//@ compile-flags: -Copt-level=1 --edition=2021
async fn return_str() -> str
where
str: Sized,
{
*"Sized".to_string().into_boxed_str()
}
fn main() {}

8
tests/crashes/135210.rs Normal file
View file

@ -0,0 +1,8 @@
//@ known-bug: #135210
#![feature(const_trait_impl)]
const _: fn(&String) = |s| {
&*s as &str;
};
fn main() {}

5
tests/crashes/135341.rs Normal file
View file

@ -0,0 +1,5 @@
//@ known-bug: #135341
type A<T> = B;
type B = _;
pub fn main() {}