Skip to content

Commit b1248bc

Browse files
committed
Auto merge of #124046 - matthiaskrgr:one_or_two_more_tests____some_on_top, r=jieyouxu
crashes: add even more tests?!? adds more tests that were not already added with #124038 from the past 10 months or so. Need a couple more passes through the tracker to filter out more missing ice /fixed tests but we're slowly getting there.
2 parents 5260893 + 06335c6 commit b1248bc

27 files changed

Lines changed: 723 additions & 0 deletions

‎tests/crashes/112623.rs‎

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
//@ known-bug: #112623
2+
3+
#![feature(const_trait_impl, effects)]
4+
5+
#[const_trait]
6+
traitValue{
7+
fnvalue() -> u32;
8+
}
9+
10+
constfnget_value<T: ~constValue>() -> u32{
11+
T::value()
12+
}
13+
14+
structFortyTwo;
15+
16+
implconstValueforFortyTwo{
17+
fnvalue() -> i64{
18+
42
19+
}
20+
}
21+
22+
constFORTY_TWO:u32 = get_value::<FortyTwo>();
23+
24+
fnmain(){
25+
assert_eq!(FORTY_TWO,42);
26+
}

‎tests/crashes/114198-2.rs‎

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
//@ known-bug: #114198
2+
//@ compile-flags: -Zprint-mono-items=eager
3+
4+
implTraitfor <TyasOwner>::Struct{}
5+
traitTrait{
6+
fntest(&self){}
7+
}
8+
9+
enumTy{}
10+
traitOwner{typeStruct: ?Sized;}
11+
implOwnerforTy{
12+
typeStruct = dynTrait + Send;
13+
}
14+
15+
fnmain(){}

‎tests/crashes/114198.rs‎

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
//@ known-bug: #114198
2+
//@ compile-flags: -Zprint-mono-items=eager
3+
4+
#![feature(lazy_type_alias)]
5+
6+
implTraitforStruct{}
7+
traitTrait{
8+
fntest(&self){}
9+
}
10+
11+
typeStruct = dynTrait + Send;
12+
13+
fnmain(){}

‎tests/crashes/118185.rs‎

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
//@ known-bug: #118185
2+
3+
fnmain(){
4+
let target:Target = create_target();
5+
target.get(0);// correct arguments work
6+
target.get(10.0);// CRASH HERE
7+
}
8+
9+
// must be generic
10+
fncreate_target<T>() -> T{
11+
unimplemented!()
12+
}
13+
14+
// unimplemented trait, but contains function with the same name
15+
pubtraitRandomTrait{
16+
fnget(&mutself);// but less arguments
17+
}
18+
19+
structTarget;
20+
21+
implTarget{
22+
// correct function with arguments
23+
pubfnget(&self,data:i32){
24+
unimplemented!()
25+
}
26+
}

‎tests/crashes/120421.rs‎

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
//@ known-bug: #120421
2+
//@ compile-flags: -Zlint-mir
3+
4+
#![feature(never_patterns)]
5+
6+
enumVoid{}
7+
8+
fnmain(){
9+
let res_void:Result<bool,Void> = Ok(true);
10+
11+
for(Ok(mut _x) | Err(!))in[res_void]{}
12+
}

‎tests/crashes/120792.rs‎

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
//@ known-bug: #120792
2+
//@ compile-flags: -Zpolymorphize=on -Zinline-mir=yes
3+
4+
implTrait<()>for(){
5+
fnfoo<'a,K>(self, _:(), _:K){
6+
todo!();
7+
}
8+
}
9+
10+
traitFoo<T>{}
11+
12+
impl<F,T>Foo<T>forF{
13+
fnmain(){
14+
().foo((),());
15+
}
16+
}
17+
18+
traitTrait<T>{
19+
fnfoo<'a,K>(self, _:T, _:K)
20+
where
21+
T:'a,
22+
K:'a;
23+
}
24+
25+
pubfnmain(){}

‎tests/crashes/120811.rs‎

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
//@ known-bug: #120811
2+
3+
traitContainer{
4+
typeItem<'a>;
5+
}
6+
implContainerfor(){
7+
typeItem<'a> = ();
8+
}
9+
structExchange<C,F>{
10+
_marker: std::marker::PhantomData<(C,F)>,
11+
}
12+
fnexchange<C,F>(_:F) -> Exchange<C,F>
13+
where
14+
C:Container,
15+
for<'a>F:FnMut(&C::Item<'a>),
16+
{
17+
unimplemented!()
18+
}
19+
traitParallelization<C>{}
20+
impl<C,F>Parallelization<C>forExchange<C,F>{}
21+
fnunary_frontier<P:Parallelization<()>>(_:P){}
22+
fnmain(){
23+
let exchange = exchange(|_| ());
24+
let _ = || {
25+
unary_frontier(exchange);
26+
};
27+
}

‎tests/crashes/121063.rs‎

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
//@ known-bug: #121063
2+
//@ compile-flags: -Zpolymorphize=on --edition=2021 -Zinline-mir=yes
3+
4+
use std::{
5+
fmt, ops,
6+
path::{Component,Path,PathBuf},
7+
};
8+
9+
pubstructAbsPathBuf(PathBuf);
10+
11+
implTryFrom<PathBuf>forAbsPathBuf{
12+
typeError = PathBuf;
13+
fntry_from(path:implAsRef<Path>) -> Result<AbsPathBuf,PathBuf>{}
14+
}
15+
16+
implTryFrom<&str>forAbsPathBuf{
17+
fntry_from(path:&str) -> Result<AbsPathBuf,PathBuf>{
18+
AbsPathBuf::try_from(PathBuf::from(path))
19+
}
20+
}

‎tests/crashes/121127.rs‎

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
//@ known-bug: #121127
2+
//@ compile-flags: -Zpolymorphize=on -Zinline-mir=yes
3+
4+
#![feature(specialization)]
5+
6+
pubtraitFoo{
7+
fnabc() -> u32;
8+
}
9+
10+
pubtraitMarker{}
11+
12+
impl<T>FooforT{
13+
defaultfnabc(f:fn(&T),t:&T) -> u32{
14+
16
15+
}
16+
}
17+
18+
impl<T:Marker>FooforT{
19+
fndef() -> u32{
20+
Self::abc()
21+
}
22+
}

‎tests/crashes/123456.rs‎

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
//@ known-bug: #123456
2+
3+
traitProject{
4+
constSELF:Self;
5+
}
6+
7+
fntake1(
8+
_:Project<
9+
SELF = {
10+
j2.join().unwrap();
11+
},
12+
>,
13+
){
14+
}
15+
16+
pubfnmain(){}

0 commit comments

Comments
 (0)