Skip to content

Commit 397a35d

Browse files
committed
crashes: add lastest batch of crash tests
1 parent 872a856 commit 397a35d

File tree

9 files changed

+148
-0
lines changed

9 files changed

+148
-0
lines changed

tests/crashes/124436.rs

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
//@ known-bug: rust-lang/rust#124436
2+
//@ compile-flags: -Zdump-mir=all -Zpolymorphize=on
3+
4+
pub trait TraitCat {}
5+
pub trait TraitDog {}
6+
7+
pub fn gamma<T: TraitCat + TraitDog>(t: [TraitDog; 32]) {}

tests/crashes/124440.rs

+23
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
//@ known-bug: rust-lang/rust#124440
2+
3+
#![allow(warnings)]
4+
5+
trait Foo {}
6+
7+
impl<F> Foo for F where F: FnMut(&()) {}
8+
9+
struct Bar<F> {
10+
f: F,
11+
}
12+
13+
impl<F> Foo for Bar<F> where F: Foo {}
14+
15+
fn assert_foo<F>(_: F)
16+
where
17+
Bar<F>: Foo,
18+
{
19+
}
20+
21+
fn main() {
22+
assert_foo(|_| ());
23+
}

tests/crashes/124464.rs

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
//@ known-bug: rust-lang/rust #124464
2+
enum TestOption<T> {
3+
TestSome(T),
4+
TestSome(T),
5+
}
6+
7+
pub struct Request {
8+
bar: TestOption<u64>,
9+
bar: u8,
10+
}
11+
12+
fn default_instance() -> &'static Request {
13+
static instance: Request = Request { bar: 17 };
14+
&instance
15+
}
16+
17+
pub fn main() {}

tests/crashes/124490.rs

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
//@ known-bug: rust-lang/rust#124490
2+
use io::{self as std};
3+
use std::collections::{self as io};
4+
5+
mod a {
6+
pub mod b {
7+
pub mod c {}
8+
}
9+
}
10+
11+
use a::*;
12+
13+
use b::c;
14+
use c as b;
15+
16+
fn main() {}

tests/crashes/124552.rs

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
//@ known-bug: rust-lang/rust#124552
2+
3+
struct B;
4+
5+
struct Foo {
6+
b: u32,
7+
b: B,
8+
}
9+
10+
static BAR: Foo = Foo { b: B };
11+
12+
fn main() {}

tests/crashes/124563.rs

+46
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
//@ known-bug: rust-lang/rust#124563
2+
3+
use std::marker::PhantomData;
4+
5+
pub trait Trait {}
6+
7+
pub trait Foo {
8+
type Trait: Trait;
9+
type Bar: Bar;
10+
fn foo(&mut self);
11+
}
12+
13+
pub struct FooImpl<'a, 'b, A: Trait>(PhantomData<&'a &'b A>);
14+
15+
impl<'a, 'b, T> Foo for FooImpl<'a, 'b, T>
16+
where
17+
T: Trait,
18+
{
19+
type Trait = T;
20+
type Bar = BarImpl<'a, 'b, T>;
21+
22+
fn foo(&mut self) {
23+
self.enter_scope(|ctx| {
24+
BarImpl(ctx);
25+
});
26+
}
27+
}
28+
29+
impl<'a, 'b, T> FooImpl<'a, 'b, T>
30+
where
31+
T: Trait,
32+
{
33+
fn enter_scope(&mut self, _scope: impl FnOnce(&mut Self)) {}
34+
}
35+
pub trait Bar {
36+
type Foo: Foo;
37+
}
38+
39+
pub struct BarImpl<'a, 'b, T: Trait>(&'b mut FooImpl<'a, 'b, T>);
40+
41+
impl<'a, 'b, T> Bar for BarImpl<'a, 'b, T>
42+
where
43+
T: Trait,
44+
{
45+
type Foo = FooImpl<'a, 'b, T>;
46+
}

tests/crashes/124583.rs

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
//@ known-bug: rust-lang/rust#124583
2+
3+
fn main() {
4+
let _ = -(-0.0f16);
5+
}

tests/crashes/124702.rs

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
//@ known-bug: rust-lang/rust#124702
2+
//@ compile-flags: -Znext-solver=coherence
3+
trait X {}
4+
5+
trait Z {
6+
type Assoc: Y;
7+
}
8+
struct A<T>(T);
9+
10+
impl<T: X> Z for A<T> {
11+
type Assoc = T;
12+
}
13+
14+
impl<T> From<<A<A<T>> as Z>::Assoc> for T {}

tests/crashes/124751.rs

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
//@ known-bug: rust-lang/rust#124751
2+
//@ compile-flags: -Zunstable-options --edition=2024
3+
4+
#![feature(gen_blocks)]
5+
6+
fn main() {
7+
let _ = async gen || {};
8+
}

0 commit comments

Comments
 (0)