Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tests: more ice tests #130409

Merged
merged 1 commit into from
Sep 16, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
tests: more ice tests
  • Loading branch information
matthiaskrgr committed Sep 15, 2024
commit 9d761eac40d9c3863cab896f4b2bf3241bb88aeb
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() {}
Loading