Skip to content

Commit a94fce9

Browse files
committed
Auto merge of #132789 - matthiaskrgr:debug_tests, r=jieyouxu
add some debug-assertion crash tests r? ghost try-job: x86_64-gnu
2 parents 8e37e15 + 716d99c commit a94fce9

10 files changed

Lines changed: 146 additions & 0 deletions

File tree

‎tests/crashes/116979.rs‎

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
//@ known-bug: #116979
2+
//@ compile-flags: -Csymbol-mangling-version=v0
3+
//@ needs-rustc-debug-assertions
4+
5+
#![feature(dyn_star)]
6+
#![allow(incomplete_features)]
7+
8+
use std::fmt::Display;
9+
10+
pubfnrequire_dyn_star_display(_:dyn*Display){}
11+
12+
fnmain(){
13+
require_dyn_star_display(1usize);
14+
}

‎tests/crashes/117808.rs‎

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
//@ known-bug: #117808
2+
//@ edition:2021
3+
//@ needs-rustc-debug-assertions
4+
5+
use std::future::Future;
6+
7+
fnhrc<R,F:for<'a>AsyncClosure<'a,(),R>>(f:F) -> F{
8+
f
9+
}
10+
11+
fnmain(){
12+
hrc(|x| async{});
13+
}
14+
15+
traitAsyncClosure<'a,I,R>
16+
where
17+
I:'a,
18+
{
19+
}
20+
21+
impl<'a,I,R,Fut,F>AsyncClosure<'a,I,R>forF
22+
where
23+
I:'a,
24+
F:Fn(&'aI) -> Fut,
25+
Fut:Future<Output = R> + Send + 'a,
26+
{
27+
}

‎tests/crashes/117877.rs‎

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
//@ known-bug: #117877
2+
//@ edition:2021
3+
//@ needs-rustc-debug-assertions
4+
//@ only-x86_64
5+
#![feature(asm_const)]
6+
7+
use std::arch::asm;
8+
9+
asyncunsafefnfoo<'a>(){
10+
asm!("/* {0} */",constN);
11+
}
12+
13+
fnmain(){}

‎tests/crashes/118778.rs‎

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
//@ known-bug: #118778
2+
//@ edition:2021
3+
//@ needs-rustc-debug-assertions
4+
5+
#![feature(generic_const_exprs)]
6+
#![allow(incomplete_features)]
7+
8+
traitOwner{
9+
typeT<constN:u16>;
10+
}
11+
12+
implOwnerfor(){
13+
typeT<constN:u32> = U32<{N + 1}>
14+
where
15+
U32<{N + 1}>:;
16+
}
17+
18+
structU32<constN:u32>;
19+
20+
fntake1(_:implOwner<T<1> = U32<1>>){}
21+
22+
fnmain(){
23+
take1(());
24+
}

‎tests/crashes/118784.rs‎

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
//@ known-bug: #118784
2+
//@ needs-rustc-debug-assertions
3+
4+
use std::collections::HashMap;
5+
6+
macro_rules! all_sync_send {
7+
($ctor:expr, $($iter:expr),+) => ({
8+
$(
9+
letmut x = $ctor;
10+
is_sync(x.$iter());
11+
letmut y = $ctor;
12+
is_send(y.$iter());
13+
)+
14+
})
15+
}
16+
17+
fnmain(){
18+
all_sync_send!(HashMap,HashMap);
19+
}

‎tests/crashes/120175.rs‎

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
//@ known-bug: #120175
2+
//@ needs-rustc-debug-assertions
3+
4+
#![feature(extern_types)]
5+
6+
#[link(name = "bar", import_name_type = "decorated", kind = "raw-dylib")]
7+
extern"C"{
8+
pubtypeCrossCrate;
9+
}
10+
11+
fnmain(){}

‎tests/crashes/121176.rs‎

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
//@ known-bug: #121176
2+
//@ needs-rustc-debug-assertions
3+
use std::fmt::Debug;
4+
5+
staticSTATIC_1:dynDebug + Sync = *();
6+
7+
fnmain(){
8+
println!("{:?}",&STATIC_1);
9+
}

‎tests/crashes/123861.rs‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
//@ known-bug: #123861
2+
//@ needs-rustc-debug-assertions
3+
4+
struct_;
5+
fn mainIterator<_ = _>{}

‎tests/crashes/123862.rs‎

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
//@ known-bug: #123862
2+
//@ needs-rustc-debug-assertions
3+
4+
macro_rules! pos {
5+
() => {
6+
(file![$($pos,)* pos!()], line!())
7+
};
8+
}
9+
10+
fnouter(){
11+
inner_inlined(main_pos,pos!());
12+
}
13+
14+
fninner_inlined(){}

‎tests/crashes/130395.rs‎

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
//@ known-bug: #130395
2+
//@ needs-rustc-debug-assertions
3+
4+
enumU{
5+
B(isize,usize),
6+
}
7+
8+
fnmain(){
9+
let x = T::A(U::C);
10+
}

0 commit comments

Comments
 (0)