Skip to content

Commit 55b4ee7

Browse files
authored
Rollup merge of #131447 - matthiaskrgr:morecrashtests, r=compiler-errors
add more crash tests r? `@jieyouxu`
2 parents 8630de3 + 6774856 commit 55b4ee7

21 files changed

Lines changed: 343 additions & 0 deletions

‎tests/crashes/130956.rs‎

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
//@ known-bug: #130956
2+
3+
mod impl_trait_mod {
4+
usesuper::*;
5+
pubtypeOpaqueBlock = implTrait;
6+
pubtypeOpaqueIf = implTrait;
7+
8+
pubstructBlockWrapper(OpaqueBlock);
9+
pubstructIfWrapper(pubOpaqueIf);
10+
11+
pubfnif_impl() -> Parser<OpaqueIf>{
12+
bind(option(block()), |_| block())
13+
}
14+
}
15+
use impl_trait_mod::*;
16+
17+
pubtraitTrait{
18+
typeAssoc;
19+
}
20+
pubstructParser<P>(P);
21+
pubstructBind<P,F>(P,F);
22+
impl<P,F>TraitforBind<P,F>{typeAssoc = ();}
23+
implTraitforBlockWrapper{typeAssoc = ();}
24+
implTraitforIfWrapper{typeAssoc = ();}
25+
26+
pubfnblock() -> Parser<BlockWrapper>{
27+
loop{}
28+
}
29+
pubfnoption<P:Trait>(arg:Parser<P>) -> Parser<implTrait>{
30+
bind(arg, |_| block())
31+
}
32+
fnbind<P:Trait,P2,F:Fn(P::Assoc) -> Parser<P2>>(_:Parser<P>, _:F) -> Parser<Bind<P,F>>
33+
{loop{}}
34+
35+
fnmain(){
36+
if_impl().0;
37+
}

‎tests/crashes/130967.rs‎

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
//@ known-bug: #130967
2+
3+
traitProducer{
4+
typeProduced;
5+
fnmake_one() -> Self::Produced;
6+
}
7+
8+
impl<E: ?Sized>Producerfor(){
9+
typeProduced = Option<E>;
10+
fnmake_one() -> Self::Produced{
11+
loop{}
12+
}
13+
}

‎tests/crashes/131046.rs‎

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
//@ known-bug: #131046
2+
3+
traitOwner{
4+
constC<constN:u32>:u32;
5+
}
6+
7+
implOwnerfor(){
8+
constC<constN:u32>:u32 = N;
9+
}
10+
11+
fntake0<constN:u64>(_:implOwner<C<N> = {N}>){}
12+
13+
fnmain(){
14+
take0::<128>(());
15+
}

‎tests/crashes/131048.rs‎

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
//@ known-bug: #131048
2+
3+
impl<A> std::ops::CoerceUnsized<A>forA{}
4+
5+
fnmain(){
6+
format_args!("Hello, world!");
7+
}

‎tests/crashes/131050.rs‎

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
//@ known-bug: #131050
2+
//@ compile-flags: --edition=2021
3+
4+
fnquery_as<D>(){}
5+
6+
asyncfncreate_user(){
7+
query_as();
8+
}
9+
10+
asyncfnpost_user_filter() -> implFilter{
11+
AndThen(&(), || async{create_user().await})
12+
}
13+
14+
asyncfnget_app() -> implSend{
15+
post_user_filter().await
16+
}
17+
18+
traitFilter{}
19+
20+
structAndThen<T,F>(T,F);
21+
22+
impl<T,F,R>FilterforAndThen<T,F>
23+
where
24+
F:Fn() -> R,
25+
R:Send,
26+
{
27+
}

‎tests/crashes/131052.rs‎

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
//@ known-bug: #131052
2+
#![feature(adt_const_params)]
3+
4+
structConstBytes<constT:&'static[*mutu8;3]>;
5+
6+
pubfnmain(){
7+
let _:ConstBytes<b"AAA"> = ConstBytes::<b"BBB">;
8+
}

‎tests/crashes/131101.rs‎

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
//@ known-bug: #131101
2+
traitFoo<constN:u8>{
3+
fndo_x(&self) -> [u8;N];
4+
}
5+
6+
structBar;
7+
8+
implFoo<const3>forBar{
9+
fndo_x(&self) -> [u8;3]{
10+
[0u8;3]
11+
}
12+
}

‎tests/crashes/131102.rs‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
//@ known-bug: #131102
2+
pubstructBlorb<constN:u16>([String;N]);
3+
pubstructWrap(Blorb<0>);
4+
pubconstfni(_:Wrap){}

‎tests/crashes/131103.rs‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
//@ known-bug: #131103
2+
structStruct<constN:i128>(pub[u8;N]);
3+
4+
pubfnfunction(value:Struct<3>) -> u8{
5+
value.0[0]
6+
}

‎tests/crashes/131190.rs‎

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
//@ known-bug: #131190
2+
//@ compile-flags: -Cinstrument-coverage --edition=2018
3+
4+
use std::future::Future;
5+
6+
pubfnblock_on<T>(fut:implFuture<Output = T>) -> T{}
7+
8+
asyncfncall_once(f:implasyncFnOnce(DropMe)){
9+
f(DropMe("world")).await;
10+
}
11+
12+
structDropMe(&'staticstr);
13+
14+
pubfnmain(){
15+
block_on(async{
16+
let async_closure = asyncmove |a:DropMe| {};
17+
call_once(async_closure).await;
18+
});
19+
}

0 commit comments

Comments
 (0)