Skip to content

Commit 041eb7a

Browse files
authored
Unrolled build for rust-lang#129869
Rollup merge of rust-lang#129869 - cyrgani:master, r=Mark-Simulacrum add a few more crashtests Added them for rust-lang#123629, rust-lang#127033 and rust-lang#129372.
2 parents 12b26c1 + 4a93071 commit 041eb7a

File tree

3 files changed

+80
-0
lines changed

3 files changed

+80
-0
lines changed

tests/crashes/123629.rs

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
//@ known-bug: #123629
2+
#![feature(generic_assert)]
3+
4+
fn foo()
5+
where
6+
for<const N: usize = { assert!(u) }> ():,
7+
{
8+
}
9+
10+
fn main() {}

tests/crashes/127033.rs

+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
//@ known-bug: #127033
2+
//@ compile-flags: --edition=2021
3+
4+
pub trait RaftLogStorage {
5+
fn save_vote(vote: ()) -> impl std::future::Future + Send;
6+
}
7+
8+
struct X;
9+
impl RaftLogStorage for X {
10+
fn save_vote(vote: ()) -> impl std::future::Future {
11+
loop {}
12+
async {
13+
vote
14+
}
15+
}
16+
}
17+
18+
fn main() {}

tests/crashes/129372.rs

+52
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
//@ known-bug: #129372
2+
//@ compile-flags: -Cdebuginfo=2 -Copt-level=0
3+
4+
pub struct Wrapper<T>(T);
5+
struct Struct;
6+
7+
pub trait TraitA {
8+
type AssocA<'t>;
9+
}
10+
pub trait TraitB {
11+
type AssocB;
12+
}
13+
14+
pub fn helper(v: impl MethodTrait) {
15+
let _local_that_causes_ice = v.method();
16+
}
17+
18+
pub fn main() {
19+
helper(Wrapper(Struct));
20+
}
21+
22+
pub trait MethodTrait {
23+
type Assoc<'a>;
24+
25+
fn method(self) -> impl for<'a> FnMut(&'a ()) -> Self::Assoc<'a>;
26+
}
27+
28+
impl<T: TraitB> MethodTrait for T
29+
where
30+
<T as TraitB>::AssocB: TraitA,
31+
{
32+
type Assoc<'a> = <T::AssocB as TraitA>::AssocA<'a>;
33+
34+
fn method(self) -> impl for<'a> FnMut(&'a ()) -> Self::Assoc<'a> {
35+
move |_| loop {}
36+
}
37+
}
38+
39+
impl<T, B> TraitB for Wrapper<B>
40+
where
41+
B: TraitB<AssocB = T>,
42+
{
43+
type AssocB = T;
44+
}
45+
46+
impl TraitB for Struct {
47+
type AssocB = Struct;
48+
}
49+
50+
impl TraitA for Struct {
51+
type AssocA<'t> = Self;
52+
}

0 commit comments

Comments
 (0)