Skip to content

Commit

Permalink
tests: more ice tests
Browse files Browse the repository at this point in the history
  • Loading branch information
matthiaskrgr committed Sep 15, 2024
1 parent 8c2c9a9 commit 9d761ea
Show file tree
Hide file tree
Showing 9 changed files with 93 additions and 0 deletions.
21 changes: 21 additions & 0 deletions tests/crashes/129262.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
//@ known-bug: rust-lang/rust#129262
//@ compile-flags: -Zvalidate-mir --edition=2018 --crate-type=lib -Copt-level=3

#![feature(async_closure)]

fn main() {}

fn needs_fn_mut<T>(mut x: impl FnMut() -> T) {
x();
}

fn hello(x: Ty) {
needs_fn_mut(async || {
x.hello();
});
}

struct Ty;
impl Ty {
fn hello(self) {}
}
9 changes: 9 additions & 0 deletions tests/crashes/129850.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
//@ known-bug: rust-lang/rust#129850

pub trait Foo2 {
fn bar<'a: 'a>(&'a mut self) -> impl Sized + use<'static>;
}

impl Foo2 for () {
fn bar<'a: 'a>(&'a mut self) -> impl Sized + 'a {}
}
6 changes: 6 additions & 0 deletions tests/crashes/130104.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
//@ known-bug: rust-lang/rust#130104

fn main() {
let non_secure_function =
core::mem::transmute::<fn() -> _, extern "C-cmse-nonsecure-call" fn() -> _>;
}
15 changes: 15 additions & 0 deletions tests/crashes/130310.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
//@ known-bug: rust-lang/rust#130310

use std::marker::PhantomData;

#[repr(C)]
struct A<T> {
a: *const A<A<T>>,
p: PhantomData<T>,
}

extern "C" {
fn f(a: *const A<()>);
}

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

#![feature(non_lifetime_binders)]
#![allow(unused)]

trait A<T>: Iterator<Item = T> {}

fn demo(x: &mut impl for<U> A<U>) {
let _: Option<u32> = x.next(); // Removing this line stops the ICE
}
9 changes: 9 additions & 0 deletions tests/crashes/130372-1.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
//@ known-bug: rust-lang/rust#130372

pub fn variadic_fn(n: usize, mut args: ...) {}

reuse variadic_fn;

fn main() {
variadic_fn();
}
11 changes: 11 additions & 0 deletions tests/crashes/130372-2.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
//@ known-bug: rust-lang/rust#130372

pub fn test_va_copy(_: u64, mut ap: ...) {}

pub fn main() {
unsafe {
test_va_copy();

call(x);
}
}
7 changes: 7 additions & 0 deletions tests/crashes/130372-3.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
//@ known-bug: rust-lang/rust#130372

fn bar() -> impl Fn() {
wrap()
}

fn wrap(...: impl ...) -> impl Fn() {}
5 changes: 5 additions & 0 deletions tests/crashes/130399.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
//@ known-bug: rust-lang/rust#130399

fn elided(main: &()) -> impl Sized + use<main> {}

fn main() {}

0 comments on commit 9d761ea

Please sign in to comment.