Skip to content

Commit 7d826ae

Browse files
committed
tests/crashes: add ICEs from matthiaskrgr/glacier2
1 parent 98dd566 commit 7d826ae

133 files changed

Lines changed: 2620 additions & 39 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎tests/crashes/101036.rs‎

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
//@ known-bug: #101036
2+
#![feature(generic_const_exprs)]
3+
4+
constfnt<constN:usize>() -> u8{
5+
Nasu8
6+
}
7+
8+
#[repr(u8)]
9+
enumT<constN:u8 = {T::<0>::Aasu8 + T::<0>::Basu8}>
10+
where
11+
[();Nasusize]:
12+
{
13+
A = t::<N>()asu8,B
14+
}

‎tests/crashes/101557.rs‎

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
//@ known-bug: #101557
2+
#![feature(generic_const_exprs)]
3+
use std::marker::PhantomData;
4+
5+
traitTrait{
6+
constCONST:usize;
7+
}
8+
9+
structA<T:Trait>{
10+
_marker:PhantomData<T>,
11+
}
12+
13+
impl<constN:usize>Traitfor[i8;N]{
14+
constCONST:usize = N;
15+
}
16+
17+
impl<constN:usize>From<usize>forA<[i8;N]>{
18+
fnfrom(_:usize) -> Self{
19+
todo!()
20+
}
21+
}
22+
23+
impl<T:Trait>From<A<[i8;T::CONST]>>forA<T>{
24+
fnfrom(_:A<[i8;T::CONST]>) -> Self{
25+
todo!()
26+
}
27+
}
28+
29+
fnf<T:Trait>() -> A<T>
30+
where
31+
[();T::CONST]:,
32+
{
33+
// Usage of `0` is arbitrary
34+
let a = A::<[i8;T::CONST]>::from(0);
35+
A::<T>::from(a)
36+
}
37+
38+
fnmain(){
39+
// Usage of `1` is arbitrary
40+
f::<[i8;1]>();
41+
}

‎tests/crashes/105275.rs‎

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
//@ known-bug: #105275
2+
//@ compile-flags: -Copt-level=0
3+
4+
pubfnencode_num<Writer:ExampleWriter>(n:u32,mutwriter:Writer) -> Result<(),Writer::Error>{
5+
if n > 15{
6+
encode_num(n / 16,&mut writer)?;
7+
}
8+
Ok(())
9+
}
10+
11+
pubtraitExampleWriter{
12+
typeError;
13+
}
14+
15+
impl<'a,T:ExampleWriter>ExampleWriterfor&'amutT{
16+
typeError = T::Error;
17+
}
18+
19+
structError;
20+
21+
implExampleWriterforError{
22+
typeError = ();
23+
}
24+
25+
fnmain(){
26+
encode_num(69,&mutError).unwrap();
27+
}

‎tests/crashes/105488.rs‎

Lines changed: 0 additions & 39 deletions
This file was deleted.

‎tests/crashes/105937.rs‎

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
//@ known-bug: #105937
2+
//@ compile-flags: -Copt-level=0
3+
4+
pubfnencode_num<Writer:ExampleWriter>(n:u32,mutwriter:Writer) -> Result<(),Writer::Error>{
5+
if n > 15{
6+
encode_num(n / 16,&mut writer)?;
7+
}
8+
Ok(())
9+
}
10+
11+
pubtraitExampleWriter{
12+
typeError;
13+
}
14+
15+
impl<'a,T:ExampleWriter>ExampleWriterfor&'amutT{
16+
typeError = T::Error;
17+
}
18+
19+
structError;
20+
21+
implExampleWriterforError{
22+
typeError = ();
23+
}
24+
25+
fnmain(){
26+
encode_num(69,&mutError).unwrap();
27+
}

‎tests/crashes/106473.rs‎

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
//@ known-bug: #106473
2+
#![feature(generic_const_exprs)]
3+
4+
constDEFAULT:u32 = 1;
5+
6+
structV<constU:usize = DEFAULT>
7+
where
8+
[();U]:;
9+
10+
traitTr{}
11+
12+
implTrforV{}

‎tests/crashes/110534.rs‎

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
//@ known-bug: #110534
2+
//@ edition:2021
3+
use core::cell::Ref;
4+
5+
structSystem;
6+
7+
traitIntoSystem{
8+
fninto_system(self) -> System;
9+
}
10+
11+
implIntoSystemforfn(Ref<'_,u32>){
12+
fninto_system(self) -> System{System}
13+
}
14+
15+
impl<A>IntoSystemforfn(A)
16+
where
17+
// n.b. No `Ref<'_, u32>` can satisfy this bound
18+
A:'static + for<'x>MaybeBorrowed<'x,Output = A>,
19+
{
20+
fninto_system(self) -> System{System}
21+
}
22+
23+
//---------------------------------------------------
24+
25+
traitMaybeBorrowed<'a>{
26+
typeOutput:'a;
27+
}
28+
29+
// If you comment this out you'll see the compiler chose to look at the
30+
// fn(A) implementation of IntoSystem above
31+
impl<'a,'b>MaybeBorrowed<'a>forRef<'b,u32>{
32+
typeOutput = Ref<'a,u32>;
33+
}
34+
35+
// ---------------------------------------------
36+
37+
fnmain(){
38+
fnsys_ref(_age:Ref<u32>){}
39+
let _sys_c = (sys_ref asfn(_)).into_system();
40+
// properly fails
41+
// let _sys_c = (sys_ref as fn(Ref<'static, u32>)).into_system();
42+
// properly succeeds
43+
// let _sys_c = (sys_ref as fn(Ref<'_, u32>)).into_system();
44+
}

‎tests/crashes/110627.rs‎

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
//@ known-bug: #110627
2+
#![feature(non_lifetime_binders)]
3+
4+
fntake(id:implfor<T>Fn(T) -> T){}
5+
6+
fnmain(){
7+
take(|x| x)
8+
}

‎tests/crashes/111419.rs‎

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
//@ known-bug: #111419
2+
#![allow(incomplete_features)]
3+
#![feature(generic_const_exprs, generic_arg_infer)]
4+
5+
pubtraitExample<constX:usize,constY:usize,constZ:usize = {X + Y}>
6+
where
7+
[();X + Y]:,
8+
{}
9+
10+
impl<constX:usize,constY:usize>Example<X,Y>forValue{}
11+
12+
pubstructValue;
13+
14+
fnmain(){}

‎tests/crashes/111699.rs‎

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
//@ known-bug: #111699
2+
#![feature(core_intrinsics)]
3+
use std::intrinsics::offset;
4+
5+
fnmain(){
6+
let a = [1u8,2,3];
7+
let ptr:*constu8 = a.as_ptr();
8+
9+
unsafe{
10+
assert_eq!(*offset(ptr,0),1);
11+
}
12+
}

0 commit comments

Comments
 (0)