Skip to content

Commit b015f61

Browse files
committed
add more known-crashes tests
1 parent e0586a6 commit b015f61

9 files changed

Lines changed: 122 additions & 0 deletions

File tree

‎tests/crashes/103708.rs‎

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
//@ known-bug: #103708
2+
#![feature(min_specialization)]
3+
4+
traitMySpecTrait{
5+
fnf();
6+
}
7+
8+
impl<'a,T: ?Sized>MySpecTraitforT{
9+
defaultfnf(){}
10+
}
11+
12+
impl<'a,T: ?Sized>MySpecTraitfor&'aT{
13+
fnf(){}
14+
}
15+
16+
fnmain(){}

‎tests/crashes/104685.rs‎

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
//@ known-bug: #104685
2+
//@ compile-flags: -Zextra-const-ub-checks
3+
#![feature(extern_types)]
4+
5+
extern{
6+
pubtypeExternType;
7+
}
8+
9+
extern"C"{
10+
pubstaticEXTERN:ExternType;
11+
}
12+
13+
pubstaticEMPTY:() = unsafe{&EXTERN;};
14+
15+
fnmain(){}

‎tests/crashes/105249.rs‎

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
//@ known-bug: #105249
2+
//@ compile-flags: -Zpolymorphize=on
3+
4+
traitFoo<T>{
5+
fnprint<'a>(&'aself)whereT:'a{println!("foo");}
6+
}
7+
8+
impl<'a>Foo<&'a()>for(){}
9+
10+
traitBar:for<'a>Foo<&'a()>{}
11+
12+
implBarfor(){}
13+
14+
fnmain(){
15+
(&()as&dynBar).print();// Segfault
16+
}

‎tests/crashes/115994.rs‎

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
//@ known-bug: #115994
2+
//@ compile-flags: -Cdebuginfo=2 --crate-type lib
3+
4+
// To prevent "overflow while adding drop-check rules".
5+
use std::mem::ManuallyDrop;
6+
7+
pubenumFoo<U>{
8+
Leaf(U),
9+
10+
Branch(BoxedFoo<BoxedFoo<U>>),
11+
}
12+
13+
pubtypeBoxedFoo<U> = ManuallyDrop<Box<Foo<U>>>;
14+
15+
pubfntest() -> Foo<usize>{
16+
todo!()
17+
}

‎tests/crashes/116721.rs‎

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
//@ known-bug: #116721
2+
//@ compile-flags: -Zmir-opt-level=3 --emit=mir
3+
fnhey<T>(it:&[T])
4+
where
5+
[T]:Clone,
6+
{
7+
}
8+
9+
fnmain(){}

‎tests/crashes/118244.rs‎

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
//@ known-bug: #118244
2+
//@ compile-flags: -Cdebuginfo=2
3+
4+
#![allow(incomplete_features)]
5+
#![feature(generic_const_exprs)]
6+
structInner<constN:usize,constM:usize>;
7+
impl<constN:usize,constM:usize>Inner<N,M>where[();N + M]:{
8+
fni() -> Self{
9+
Self
10+
}
11+
}
12+
13+
structOuter<constA:usize,constB:usize>(Inner<A,{B*2}>)where[();A + (B*2)]:;
14+
impl<constA:usize,constB:usize>Outer<A,B>where[();A + (B*2)]:{
15+
fno() -> Self{
16+
Self(Inner::i())
17+
}
18+
}
19+
20+
fnmain(){
21+
Outer::<1,1>::o();
22+
}

‎tests/crashes/124083.rs‎

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
//@ known-bug: #124083
2+
3+
structOutest(&'a());
4+
5+
fnmake() -> Outest{}
6+
7+
fnmain(){
8+
ifletOutest("foo") = make(){}
9+
}

‎tests/crashes/124151.rs‎

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
//@ known-bug: #124151
2+
#![feature(generic_const_exprs)]
3+
4+
use std::ops::Add;
5+
6+
pubstructDimension;
7+
8+
pubstructQuantity<S,constD:Dimension>(S);
9+
10+
impl<constD:Dimension,LHS,RHS>Add<LHS,D>forQuantity<LHS,{Dimension}>{}
11+
12+
pubfnadd<constU:Dimension>(x:Quantity<f32,U>) -> Quantity<f32,U>{
13+
x + y
14+
}

‎tests/crashes/124164.rs‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
//@ known-bug: #124164
2+
staticS_COUNT: = std::sync::atomic::AtomicUsize::new(0);
3+
4+
fnmain(){}

0 commit comments

Comments
 (0)