Skip to content

Commit 0406f12

Browse files
authored
Rollup merge of rust-lang#130409 - matthiaskrgr:ccccrashes, r=compiler-errors
tests: more ice tests r? `@jieyouxu`
2 parents 62445f1 + 9d761ea commit 0406f12

File tree

9 files changed

+93
-0
lines changed

9 files changed

+93
-0
lines changed

tests/crashes/129262.rs

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
//@ known-bug: rust-lang/rust#129262
2+
//@ compile-flags: -Zvalidate-mir --edition=2018 --crate-type=lib -Copt-level=3
3+
4+
#![feature(async_closure)]
5+
6+
fn main() {}
7+
8+
fn needs_fn_mut<T>(mut x: impl FnMut() -> T) {
9+
x();
10+
}
11+
12+
fn hello(x: Ty) {
13+
needs_fn_mut(async || {
14+
x.hello();
15+
});
16+
}
17+
18+
struct Ty;
19+
impl Ty {
20+
fn hello(self) {}
21+
}

tests/crashes/129850.rs

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
//@ known-bug: rust-lang/rust#129850
2+
3+
pub trait Foo2 {
4+
fn bar<'a: 'a>(&'a mut self) -> impl Sized + use<'static>;
5+
}
6+
7+
impl Foo2 for () {
8+
fn bar<'a: 'a>(&'a mut self) -> impl Sized + 'a {}
9+
}

tests/crashes/130104.rs

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
//@ known-bug: rust-lang/rust#130104
2+
3+
fn main() {
4+
let non_secure_function =
5+
core::mem::transmute::<fn() -> _, extern "C-cmse-nonsecure-call" fn() -> _>;
6+
}

tests/crashes/130310.rs

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
//@ known-bug: rust-lang/rust#130310
2+
3+
use std::marker::PhantomData;
4+
5+
#[repr(C)]
6+
struct A<T> {
7+
a: *const A<A<T>>,
8+
p: PhantomData<T>,
9+
}
10+
11+
extern "C" {
12+
fn f(a: *const A<()>);
13+
}
14+
15+
fn main() {}

tests/crashes/130346.rs

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
//@ known-bug: rust-lang/rust#130346
2+
3+
#![feature(non_lifetime_binders)]
4+
#![allow(unused)]
5+
6+
trait A<T>: Iterator<Item = T> {}
7+
8+
fn demo(x: &mut impl for<U> A<U>) {
9+
let _: Option<u32> = x.next(); // Removing this line stops the ICE
10+
}

tests/crashes/130372-1.rs

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
//@ known-bug: rust-lang/rust#130372
2+
3+
pub fn variadic_fn(n: usize, mut args: ...) {}
4+
5+
reuse variadic_fn;
6+
7+
fn main() {
8+
variadic_fn();
9+
}

tests/crashes/130372-2.rs

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
//@ known-bug: rust-lang/rust#130372
2+
3+
pub fn test_va_copy(_: u64, mut ap: ...) {}
4+
5+
pub fn main() {
6+
unsafe {
7+
test_va_copy();
8+
9+
call(x);
10+
}
11+
}

tests/crashes/130372-3.rs

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
//@ known-bug: rust-lang/rust#130372
2+
3+
fn bar() -> impl Fn() {
4+
wrap()
5+
}
6+
7+
fn wrap(...: impl ...) -> impl Fn() {}

tests/crashes/130399.rs

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
//@ known-bug: rust-lang/rust#130399
2+
3+
fn elided(main: &()) -> impl Sized + use<main> {}
4+
5+
fn main() {}

0 commit comments

Comments
 (0)