Skip to content

Commit

Permalink
Auto merge of #132710 - matthiaskrgr:padautz, r=jieyouxu
Browse files Browse the repository at this point in the history
more crash tests

r? `@jieyouxu`
  • Loading branch information
bors committed Nov 7, 2024
2 parents 546a1ea + 9b286cf commit 9200cbc
Show file tree
Hide file tree
Showing 8 changed files with 94 additions and 0 deletions.
9 changes: 9 additions & 0 deletions tests/crashes/132127.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
//@ known-bug: #132127
#![feature(dyn_star)]

trait Trait {}

fn main() {
let x: dyn* Trait + Send = 1usize;
x as dyn* Trait;
}
3 changes: 3 additions & 0 deletions tests/crashes/132142.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
//@ known-bug: #132142

async extern "C-cmse-nonsecure-entry" fn fun(...) {}
15 changes: 15 additions & 0 deletions tests/crashes/132320.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
//@ known-bug: #132320
//@ compile-flags: -Znext-solver=globally

trait Foo {
type Item;
fn foo(&mut self);
}

impl Foo for () {
type Item = Option<()>;

fn foo(&mut self) {
let _ = Self::Item::None;
}
}
28 changes: 28 additions & 0 deletions tests/crashes/132330.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
//@ known-bug: #132330
//@compile-flags: -Znext-solver=globally

trait Service {
type S;
}

trait Framing {
type F;
}

impl Framing for () {
type F = ();
}

trait HttpService<F: Framing>: Service<S = F::F> {}

type BoxService = Box<dyn HttpService<(), S = ()>>;

fn build_server<F: FnOnce() -> BoxService>(_: F) {}

fn make_server<F: Framing>() -> Box<dyn HttpService<F, S = F::F>> {
unimplemented!()
}

fn main() {
build_server(|| make_server())
}
13 changes: 13 additions & 0 deletions tests/crashes/132335.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
//@ known-bug: #132335
//@ compile-flags: -Znext-solver=globally --crate-type lib --edition=2018
use core::future::Future;
use core::pin::Pin;

pub trait Unit {}
impl Unit for () {}

pub fn get_all_files_in_dir() -> Pin<Box<dyn Future<Output = impl Unit>>> {
Box::pin(async {
get_all_files_in_dir().await;
})
}
8 changes: 8 additions & 0 deletions tests/crashes/132391.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
//@ known-bug: #123291

trait MyTrait {
#[repr(align)]
fn myfun();
}

pub fn main() {}
9 changes: 9 additions & 0 deletions tests/crashes/132430.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
//@ known-bug: #132430

//@compile-flags: --edition=2018 --crate-type=lib
#![feature(cmse_nonsecure_entry)]
struct Test;

impl Test {
pub async unsafe extern "C-cmse-nonsecure-entry" fn test(val: &str) {}
}
9 changes: 9 additions & 0 deletions tests/crashes/132530.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
//@ known-bug: #132530

#![feature(non_lifetime_binders)]

trait Trait<'a, A> {
type Assoc<'a> = i32;
}

fn a() -> impl for<T> Trait<Assoc = impl Trait<T>> {}

0 comments on commit 9200cbc

Please sign in to comment.