-
Notifications
You must be signed in to change notification settings - Fork 12.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add .rs crashes from https://github.com/rust-lang/glacier
- Loading branch information
1 parent
e473247
commit da8597f
Showing
31 changed files
with
664 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
//@ known-bug: #100041 | ||
|
||
pub trait WellUnformed { | ||
type RequestNormalize; | ||
} | ||
|
||
impl<T: ?Sized> WellUnformed for T { | ||
type RequestNormalize = (); | ||
} | ||
|
||
pub fn latent(_: &[<[[()]] as WellUnformed>::RequestNormalize; 0]) {} | ||
|
||
pub fn bang() { | ||
latent(&[]); | ||
} | ||
|
||
fn main() {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
//@ known-bug: #101962 | ||
|
||
#![feature(core_intrinsics)] | ||
|
||
pub fn wrapping<T: Copy>(a: T, b: T) { | ||
let _z = core::intrinsics::wrapping_mul(a, b); | ||
} | ||
|
||
fn main() { | ||
wrapping(1,2); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
//@ known-bug: #102047 | ||
|
||
struct Ty1; | ||
struct Ty2; | ||
|
||
pub trait Trait<T> {} | ||
|
||
pub trait WithAssoc1<'a> { | ||
type Assoc; | ||
} | ||
pub trait WithAssoc2<'a> { | ||
type Assoc; | ||
} | ||
|
||
impl<T, U> Trait<for<'a> fn(<T as WithAssoc1<'a>>::Assoc, <U as WithAssoc2<'a>>::Assoc)> for (T, U) | ||
where | ||
T: for<'a> WithAssoc1<'a> + for<'a> WithAssoc2<'a, Assoc = i32>, | ||
U: for<'a> WithAssoc2<'a>, | ||
{ | ||
} | ||
|
||
impl WithAssoc1<'_> for Ty1 { | ||
type Assoc = (); | ||
} | ||
impl WithAssoc2<'_> for Ty1 { | ||
type Assoc = i32; | ||
} | ||
impl WithAssoc1<'_> for Ty2 { | ||
type Assoc = (); | ||
} | ||
impl WithAssoc2<'_> for Ty2 { | ||
type Assoc = u32; | ||
} | ||
|
||
fn foo<T, U, V>() | ||
where | ||
T: for<'a> WithAssoc1<'a>, | ||
U: for<'a> WithAssoc2<'a>, | ||
(T, U): Trait<V>, | ||
{ | ||
} | ||
|
||
fn main() { | ||
foo::<Ty1, Ty2, _>(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
//@ known-bug: #102252 | ||
|
||
#![feature(min_specialization, rustc_attrs)] | ||
|
||
#[rustc_specialization_trait] | ||
pub trait Trait {} | ||
|
||
struct Struct | ||
where | ||
Self: Iterator<Item = <Self as Iterator>::Item>, {} | ||
|
||
impl Trait for Struct {} | ||
|
||
fn main() {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
//@ known-bug: #103899 | ||
|
||
trait BaseWithAssoc { | ||
type Assoc; | ||
} | ||
|
||
trait WrapperWithAssoc { | ||
type BaseAssoc: BaseWithAssoc; | ||
} | ||
|
||
struct Wrapper<B> { | ||
inner: B, | ||
} | ||
|
||
struct ProjectToBase<T: BaseWithAssoc> { | ||
data_type_h: T::Assoc, | ||
} | ||
|
||
struct DoubleProject<L: WrapperWithAssoc> { | ||
buffer: Wrapper<ProjectToBase<L::BaseAssoc>>, | ||
} | ||
|
||
fn trigger<L: WrapperWithAssoc<BaseAssoc = ()>>() -> DoubleProject<L> { | ||
loop {} | ||
} | ||
|
||
fn main() {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
//@ known-bug: #105238 | ||
|
||
#![allow(incomplete_features)] | ||
#![feature(generic_const_exprs)] | ||
|
||
trait Ret { | ||
type R; | ||
} | ||
|
||
struct Cond<const PRED: bool, U, V>(std::marker::PhantomData<U>, std::marker::PhantomData<V>); | ||
|
||
impl<U, V> Ret for Cond<true, U, V> { | ||
type R = U; | ||
} | ||
|
||
impl<U, V> Ret for Cond<false, U, V> { | ||
type R = V; | ||
} | ||
|
||
struct RobinHashTable<const MAX_LENGTH: usize, CellIdx = Cond<{ MAX_LENGTH < 65535 }, u16, u32>> | ||
where | ||
CellIdx: Ret, | ||
{ | ||
_idx: CellIdx::R, | ||
} | ||
|
||
fn main() { | ||
use std::mem::size_of; | ||
println!("{}", size_of::<RobinHashTable<1024>>()); | ||
println!("{}", size_of::<RobinHashTable<65536>>()); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
//@ known-bug: #105238 | ||
|
||
#![allow(incomplete_features)] | ||
#![feature(generic_const_exprs)] | ||
|
||
trait Ret { | ||
type R; | ||
} | ||
|
||
struct Cond<const PRED: bool, U, V>(std::marker::PhantomData<U>, std::marker::PhantomData<V>); | ||
|
||
impl<U, V> Ret for Cond<true, U, V> { | ||
type R = U; | ||
} | ||
|
||
impl<U, V> Ret for Cond<false, U, V> { | ||
type R = V; | ||
} | ||
|
||
struct RobinHashTable< | ||
const MAX_LENGTH: usize, | ||
CellIdx = <Cond<{ MAX_LENGTH < 65535 }, u16, u32> as Ret>::R, | ||
> { | ||
_idx: CellIdx, | ||
} | ||
|
||
fn main() { | ||
use std::mem::size_of; | ||
println!("{}", size_of::<RobinHashTable<1024>>()); | ||
println!("{}", size_of::<RobinHashTable<65536>>()); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
//@ known-bug: #105488 | ||
|
||
pub trait MyFnOnce { | ||
type Output; | ||
|
||
fn call_my_fn_once(self) -> Self::Output; | ||
} | ||
|
||
pub struct WrapFnOnce<F>(F); | ||
|
||
impl<F: FnOnce() -> D, D: MyFnOnce> MyFnOnce for WrapFnOnce<F> { | ||
type Output = D::Output; | ||
|
||
fn call_my_fn_once(self) -> Self::Output { | ||
D::call_my_fn_once(self.0()) | ||
} | ||
} | ||
|
||
impl<F: FnOnce() -> D, D: MyFnOnce> MyFnOnce for F { | ||
type Output = D::Output; | ||
|
||
fn call_my_fn_once(self) -> Self::Output { | ||
D::call_my_fn_once(self()) | ||
} | ||
} | ||
|
||
pub fn my_fn_1() -> impl MyFnOnce { | ||
my_fn_2 | ||
} | ||
|
||
pub fn my_fn_2() -> impl MyFnOnce { | ||
WrapFnOnce(my_fn_1) | ||
} | ||
|
||
fn main() { | ||
let v = my_fn_1(); | ||
|
||
let _ = v.call_my_fn_once(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
//@ known-bug: #108814 | ||
|
||
#![feature(non_lifetime_binders)] | ||
|
||
fn take(_: impl for<T> FnOnce(T) -> T) {} | ||
|
||
fn main() { | ||
take(|x| x) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
//@ known-bug: #109681 | ||
|
||
#![crate_type="lib"] | ||
#![feature(linkage)] | ||
|
||
#[linkage = "common"] | ||
pub static TEST3: bool = true; | ||
|
||
fn main() {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
//@ known-bug: #110378 | ||
// ignore-tidy-linelength | ||
|
||
#![feature(generic_const_exprs)] | ||
|
||
fn foo<const L: usize>(_a: [u8; L], _b: [u8; L]) -> [u8; L + 1] { | ||
[0_u8; L + 1] | ||
} | ||
|
||
fn main() { | ||
let baz = [[0_u8; 1]; 8]; | ||
|
||
let _: [u8; 4] = foo(foo(foo(baz[0], baz[1]), foo(baz[2], baz[3])), foo(foo(baz[4], baz[5]), foo(baz[6], baz[7]))); | ||
//let _: [u8; 3] = foo(foo(baz[0], baz[1]), foo(baz[2], baz[3])); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
//@ known-bug: #110630 | ||
|
||
#![feature(generic_const_exprs)] | ||
|
||
use std::ops::Mul; | ||
|
||
pub trait Indices<const N: usize> { | ||
const NUM_ELEMS: usize = I::NUM_ELEMS * N; | ||
} | ||
|
||
pub trait Concat<J> { | ||
type Output; | ||
} | ||
|
||
pub struct Tensor<I: Indices<N>, const N: usize> | ||
where | ||
[u8; I::NUM_ELEMS]: Sized, {} | ||
|
||
impl<I: Indices<N>, J: Indices<N>, const N: usize> Mul<Tensor<J, N>> for Tensor<I, N> | ||
where | ||
I: Concat<T>, | ||
<I as Concat<J>>::Output: Indices<N>, | ||
[u8; I::NUM_ELEMS]: Sized, | ||
[u8; J::NUM_ELEMS]: Sized, | ||
[u8; <I as Concat<J>>::Output::NUM_ELEMS]: Sized, | ||
{ | ||
type Output = Tensor<<I as Concat<J>>::Output, N>; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
//@ known-bug: #111742 | ||
// ignore-tidy-linelength | ||
|
||
#![allow(incomplete_features)] | ||
#![feature(generic_const_exprs)] | ||
|
||
const CONST: u32 = 0; | ||
struct Test<const N: u32, const M: u32 = { CONST/* Must be a const and not a Literal */ }> where [(); N as usize]: , ([u32; N as usize]); | ||
|
||
fn main() { | ||
let _: Test<1>; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
//@ known-bug: #112201 | ||
|
||
pub fn compose( | ||
f1: impl FnOnce(f64) -> f64 + Clone, | ||
f2: impl FnOnce(f64) -> f64 + Clone, | ||
) -> impl FnOnce(f64) -> f64 + Clone { | ||
move |x| f1(f2(x)) | ||
} | ||
|
||
fn repeat_helper( | ||
f: impl FnOnce(f64) -> f64 + Clone, | ||
res: impl FnOnce(f64) -> f64 + Clone, | ||
times: usize, | ||
) -> impl FnOnce(f64) -> f64 + Clone { | ||
return res; | ||
repeat_helper(f.clone(), compose(f, res), times - 1) | ||
} | ||
|
||
fn main() {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
//@ known-bug: #113280 | ||
|
||
#![feature(dyn_star, pointer_like_trait)] | ||
#![allow(incomplete_features)] | ||
|
||
use std::fmt::Debug; | ||
use std::marker::PointerLike; | ||
|
||
fn make_dyn_star<'a>(t: impl PointerLike + Debug + 'a) -> dyn* Debug + 'a { | ||
f32::from_bits(0x1) as f64 | ||
} | ||
|
||
fn main() { | ||
println!("{:?}", make_dyn_star(Box::new(1i32))); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
//@ known-bug: #113379 | ||
|
||
async fn f999() -> Vec<usize> { | ||
'b: { | ||
continue 'b; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
//@ compile-flags: -g -Copt-level=0 | ||
//@ known-bug: #34127 | ||
|
||
pub fn main() { | ||
let _a = [(); 1 << 63]; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
//@ known-bug: #54888 | ||
|
||
#![feature(unsize, coerce_unsized)] | ||
|
||
use std::{ | ||
ops::CoerceUnsized, | ||
marker::Unsize, | ||
}; | ||
|
||
#[repr(C)] | ||
struct Ptr<T: ?Sized>(Box<T>); | ||
|
||
impl<T: ?Sized, U: ?Sized> CoerceUnsized<Ptr<U>> for Ptr<T> | ||
where | ||
T: Unsize<U>, | ||
{} | ||
|
||
|
||
fn main() { | ||
let foo = Ptr(Box::new(5)) as Ptr<dyn std::any::Any>; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
//@ known-bug: #57276 | ||
|
||
#![feature(arbitrary_self_types, dispatch_from_dyn)] | ||
|
||
use std::ops::{Deref, DispatchFromDyn}; | ||
|
||
trait Trait<T: Deref<Target = Self> + DispatchFromDyn<T>> { | ||
fn foo(self: T) -> dyn Trait<T>; | ||
} | ||
|
||
fn main() {} |
Oops, something went wrong.