Skip to content

Commit a7625b2

Browse files
committed
1 parent 3345d05 commit a7625b2

31 files changed

+664
-1
lines changed

tests/crashes/100041.rs

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
//@ known-bug: #100041
2+
3+
pub trait WellUnformed {
4+
type RequestNormalize;
5+
}
6+
7+
impl<T: ?Sized> WellUnformed for T {
8+
type RequestNormalize = ();
9+
}
10+
11+
pub fn latent(_: &[<[[()]] as WellUnformed>::RequestNormalize; 0]) {}
12+
13+
pub fn bang() {
14+
latent(&[]);
15+
}
16+
17+
fn main() {}

tests/crashes/101962.rs

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
//@ known-bug: #101962
2+
3+
#![feature(core_intrinsics)]
4+
5+
pub fn wrapping<T: Copy>(a: T, b: T) {
6+
let _z = core::intrinsics::wrapping_mul(a, b);
7+
}
8+
9+
fn main() {
10+
wrapping(1,2);
11+
}

tests/crashes/102047.rs

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
//@ known-bug: #102047
2+
3+
struct Ty1;
4+
struct Ty2;
5+
6+
pub trait Trait<T> {}
7+
8+
pub trait WithAssoc1<'a> {
9+
type Assoc;
10+
}
11+
pub trait WithAssoc2<'a> {
12+
type Assoc;
13+
}
14+
15+
impl<T, U> Trait<for<'a> fn(<T as WithAssoc1<'a>>::Assoc, <U as WithAssoc2<'a>>::Assoc)> for (T, U)
16+
where
17+
T: for<'a> WithAssoc1<'a> + for<'a> WithAssoc2<'a, Assoc = i32>,
18+
U: for<'a> WithAssoc2<'a>,
19+
{
20+
}
21+
22+
impl WithAssoc1<'_> for Ty1 {
23+
type Assoc = ();
24+
}
25+
impl WithAssoc2<'_> for Ty1 {
26+
type Assoc = i32;
27+
}
28+
impl WithAssoc1<'_> for Ty2 {
29+
type Assoc = ();
30+
}
31+
impl WithAssoc2<'_> for Ty2 {
32+
type Assoc = u32;
33+
}
34+
35+
fn foo<T, U, V>()
36+
where
37+
T: for<'a> WithAssoc1<'a>,
38+
U: for<'a> WithAssoc2<'a>,
39+
(T, U): Trait<V>,
40+
{
41+
}
42+
43+
fn main() {
44+
foo::<Ty1, Ty2, _>();
45+
}

tests/crashes/102252.rs

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
//@ known-bug: #102252
2+
3+
#![feature(min_specialization, rustc_attrs)]
4+
5+
#[rustc_specialization_trait]
6+
pub trait Trait {}
7+
8+
struct Struct
9+
where
10+
Self: Iterator<Item = <Self as Iterator>::Item>, {}
11+
12+
impl Trait for Struct {}
13+
14+
fn main() {}

tests/crashes/103899.rs

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
//@ known-bug: #103899
2+
3+
trait BaseWithAssoc {
4+
type Assoc;
5+
}
6+
7+
trait WrapperWithAssoc {
8+
type BaseAssoc: BaseWithAssoc;
9+
}
10+
11+
struct Wrapper<B> {
12+
inner: B,
13+
}
14+
15+
struct ProjectToBase<T: BaseWithAssoc> {
16+
data_type_h: T::Assoc,
17+
}
18+
19+
struct DoubleProject<L: WrapperWithAssoc> {
20+
buffer: Wrapper<ProjectToBase<L::BaseAssoc>>,
21+
}
22+
23+
fn trigger<L: WrapperWithAssoc<BaseAssoc = ()>>() -> DoubleProject<L> {
24+
loop {}
25+
}
26+
27+
fn main() {}

tests/crashes/105238-1.rs

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
//@ known-bug: #105238
2+
3+
#![allow(incomplete_features)]
4+
#![feature(generic_const_exprs)]
5+
6+
trait Ret {
7+
type R;
8+
}
9+
10+
struct Cond<const PRED: bool, U, V>(std::marker::PhantomData<U>, std::marker::PhantomData<V>);
11+
12+
impl<U, V> Ret for Cond<true, U, V> {
13+
type R = U;
14+
}
15+
16+
impl<U, V> Ret for Cond<false, U, V> {
17+
type R = V;
18+
}
19+
20+
struct RobinHashTable<const MAX_LENGTH: usize, CellIdx = Cond<{ MAX_LENGTH < 65535 }, u16, u32>>
21+
where
22+
CellIdx: Ret,
23+
{
24+
_idx: CellIdx::R,
25+
}
26+
27+
fn main() {
28+
use std::mem::size_of;
29+
println!("{}", size_of::<RobinHashTable<1024>>());
30+
println!("{}", size_of::<RobinHashTable<65536>>());
31+
}

tests/crashes/105238-2.rs

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
//@ known-bug: #105238
2+
3+
#![allow(incomplete_features)]
4+
#![feature(generic_const_exprs)]
5+
6+
trait Ret {
7+
type R;
8+
}
9+
10+
struct Cond<const PRED: bool, U, V>(std::marker::PhantomData<U>, std::marker::PhantomData<V>);
11+
12+
impl<U, V> Ret for Cond<true, U, V> {
13+
type R = U;
14+
}
15+
16+
impl<U, V> Ret for Cond<false, U, V> {
17+
type R = V;
18+
}
19+
20+
struct RobinHashTable<
21+
const MAX_LENGTH: usize,
22+
CellIdx = <Cond<{ MAX_LENGTH < 65535 }, u16, u32> as Ret>::R,
23+
> {
24+
_idx: CellIdx,
25+
}
26+
27+
fn main() {
28+
use std::mem::size_of;
29+
println!("{}", size_of::<RobinHashTable<1024>>());
30+
println!("{}", size_of::<RobinHashTable<65536>>());
31+
}

tests/crashes/105488.rs

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
//@ known-bug: #105488
2+
3+
pub trait MyFnOnce {
4+
type Output;
5+
6+
fn call_my_fn_once(self) -> Self::Output;
7+
}
8+
9+
pub struct WrapFnOnce<F>(F);
10+
11+
impl<F: FnOnce() -> D, D: MyFnOnce> MyFnOnce for WrapFnOnce<F> {
12+
type Output = D::Output;
13+
14+
fn call_my_fn_once(self) -> Self::Output {
15+
D::call_my_fn_once(self.0())
16+
}
17+
}
18+
19+
impl<F: FnOnce() -> D, D: MyFnOnce> MyFnOnce for F {
20+
type Output = D::Output;
21+
22+
fn call_my_fn_once(self) -> Self::Output {
23+
D::call_my_fn_once(self())
24+
}
25+
}
26+
27+
pub fn my_fn_1() -> impl MyFnOnce {
28+
my_fn_2
29+
}
30+
31+
pub fn my_fn_2() -> impl MyFnOnce {
32+
WrapFnOnce(my_fn_1)
33+
}
34+
35+
fn main() {
36+
let v = my_fn_1();
37+
38+
let _ = v.call_my_fn_once();
39+
}

tests/crashes/108814.rs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
//@ known-bug: #108814
2+
3+
#![feature(non_lifetime_binders)]
4+
5+
fn take(_: impl for<T> FnOnce(T) -> T) {}
6+
7+
fn main() {
8+
take(|x| x)
9+
}

tests/crashes/109681.rs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
//@ known-bug: #109681
2+
3+
#![crate_type="lib"]
4+
#![feature(linkage)]
5+
6+
#[linkage = "common"]
7+
pub static TEST3: bool = true;
8+
9+
fn main() {}

0 commit comments

Comments
 (0)