Skip to content

Commit

Permalink
Rollup merge of #131964 - matthiaskrgr:crashes2010, r=jieyouxu
Browse files Browse the repository at this point in the history
add latest crash tests

r? `@jieyouxu`
  • Loading branch information
matthiaskrgr authored Oct 20, 2024
2 parents da8a115 + eca5359 commit 5533c96
Show file tree
Hide file tree
Showing 8 changed files with 76 additions and 0 deletions.
7 changes: 7 additions & 0 deletions tests/crashes/131637.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
//@ known-bug: #121637
#![feature(non_lifetime_binders)]
trait Trait<Type> {
type Type;

fn method(&self) -> impl for<T> Trait<impl Trait<T>>;
}
7 changes: 7 additions & 0 deletions tests/crashes/131648.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
//@ known-bug: #131648
#![feature(return_type_notation)]

trait IntFactory {
fn stream(self) -> impl IntFactory<stream(..): Send>;
}
fn main() {}
12 changes: 12 additions & 0 deletions tests/crashes/131668.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
//@ known-bug: #131668

#![feature(generic_associated_types_extended)]
trait B {
type Y<const N: i16>;
}

struct Erase<T: B>(T);

fn make_static() {
Erase::<dyn for<'c> B<&'c ()>>(());
}
11 changes: 11 additions & 0 deletions tests/crashes/131758.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
//@ known-bug: #131758
#![feature(unboxed_closures)]
trait Foo {}

impl<T: Fn<(i32,)>> Foo for T {}

fn baz<T: Foo>(_: T) {}

fn main() {
baz(|x| ());
}
9 changes: 9 additions & 0 deletions tests/crashes/131762.rs
Original file line number Diff line number Diff line change
@@ -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::<u8>, size_of::<u16>, size_of::<usize> as fn() -> usize)))
}
5 changes: 5 additions & 0 deletions tests/crashes/131787.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
//@ known-bug: #131787
#[track_caller]
static no_mangle: u32 = {
unimplemented!();
};
12 changes: 12 additions & 0 deletions tests/crashes/131886.rs
Original file line number Diff line number Diff line change
@@ -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<'_, '_, ()>;
}
13 changes: 13 additions & 0 deletions tests/crashes/131915.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
//@ known-bug: #131915

macro_rules! y {
( $($matcher:tt)*) => {
x
};
}

const _: A<
{
y! { test.tou8 }
},
>;

0 comments on commit 5533c96

Please sign in to comment.