crashes: more tests
This commit is contained in:
parent
25cdf1f674
commit
c1f2ad2d16
25 changed files with 332 additions and 0 deletions
42
tests/crashes/138156.rs
Normal file
42
tests/crashes/138156.rs
Normal file
|
|
@ -0,0 +1,42 @@
|
|||
//@ known-bug: #138156
|
||||
|
||||
#![feature(generic_const_exprs)]
|
||||
|
||||
#[derive(Default)]
|
||||
pub struct GenId<const IDX: usize>;
|
||||
|
||||
pub trait IndexTrait: Default {
|
||||
const IDX: usize;
|
||||
}
|
||||
pub trait ToplogyIndex {
|
||||
type Idx: IndexTrait;
|
||||
}
|
||||
|
||||
#[derive(Default)]
|
||||
pub struct Expression<T: ToplogyIndex> {
|
||||
pub data: T,
|
||||
}
|
||||
|
||||
fn i<T: ToplogyIndex, const IDX0: usize, const IDX1: usize>(s: Expression<T>) ->
|
||||
Expression<GenId<{ IDX0 | IDX1 }>>
|
||||
where
|
||||
GenId<{ IDX0 | IDX1 }>: ToplogyIndex,
|
||||
{
|
||||
Expression::default()
|
||||
}
|
||||
|
||||
pub fn sum<In: ToplogyIndex>(s: Expression<In>) -> Expression<In>
|
||||
where
|
||||
[(); In::Idx::IDX]:,
|
||||
{
|
||||
s
|
||||
}
|
||||
|
||||
fn param_position<In: ToplogyIndex>(s: Expression<In>)
|
||||
where
|
||||
GenId<{ 1 | 2 }>: ToplogyIndex,
|
||||
{
|
||||
sum(i::<_, 1, 2>(s));
|
||||
}
|
||||
|
||||
fn main() {}
|
||||
9
tests/crashes/138240.rs
Normal file
9
tests/crashes/138240.rs
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
//@ known-bug: #138240
|
||||
//@edition:2024
|
||||
#![feature(min_generic_const_args)]
|
||||
#![feature(inherent_associated_types)]
|
||||
async fn _CF() -> Box<[u8; Box::b]> {
|
||||
Box::new(true)
|
||||
}
|
||||
|
||||
fn main() {}
|
||||
12
tests/crashes/138265.rs
Normal file
12
tests/crashes/138265.rs
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
//@ known-bug: #138265
|
||||
|
||||
#![feature(coerce_unsized)]
|
||||
#![crate_type = "lib"]
|
||||
impl<A> std::ops::CoerceUnsized<A> for A {}
|
||||
pub fn f() {
|
||||
[0; {
|
||||
let mut c = &0;
|
||||
c = &0;
|
||||
0
|
||||
}]
|
||||
}
|
||||
7
tests/crashes/138266.rs
Normal file
7
tests/crashes/138266.rs
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
//@ known-bug: #138266
|
||||
//@compile-flags: --crate-type=lib
|
||||
#![feature(min_generic_const_args)]
|
||||
#![feature(inherent_associated_types)]
|
||||
pub fn f(mut x: [u8; Box::b]) {
|
||||
x[72] = 1;
|
||||
}
|
||||
8
tests/crashes/138359.rs
Normal file
8
tests/crashes/138359.rs
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
//@ known-bug: #138359
|
||||
#![feature(min_generic_const_args)]
|
||||
#![feature(inherent_associated_types)]
|
||||
struct a(Box<[u8; Box::b]>);
|
||||
impl a {
|
||||
fn c(self) { self.0.da }
|
||||
}
|
||||
fn main() {}
|
||||
6
tests/crashes/138361.rs
Normal file
6
tests/crashes/138361.rs
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
//@ known-bug: #138361
|
||||
|
||||
fn main() {
|
||||
[0; loop{}];
|
||||
std::mem::transmute(4)
|
||||
}
|
||||
7
tests/crashes/138510.rs
Normal file
7
tests/crashes/138510.rs
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
//@ known-bug: #138510
|
||||
fn main()
|
||||
where
|
||||
#[repr()]
|
||||
_: Sized,
|
||||
{
|
||||
}
|
||||
6
tests/crashes/138534.rs
Normal file
6
tests/crashes/138534.rs
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
//@ known-bug: #138534
|
||||
//@compile-flags: -Zunpretty=expanded
|
||||
#[repr(bool)]
|
||||
pub enum TopFg {
|
||||
Bar,
|
||||
}
|
||||
26
tests/crashes/138564.rs
Normal file
26
tests/crashes/138564.rs
Normal file
|
|
@ -0,0 +1,26 @@
|
|||
//@ known-bug: #138564
|
||||
//@compile-flags: -Copt-level=0 -Cdebuginfo=2 --crate-type lib
|
||||
#![feature(unsize, dispatch_from_dyn, arbitrary_self_types)]
|
||||
|
||||
use std::marker::Unsize;
|
||||
use std::ops::{Deref, DispatchFromDyn};
|
||||
|
||||
#[repr(align(16))]
|
||||
pub struct MyPointer<T: ?Sized>(*const T);
|
||||
|
||||
impl<T: ?Sized + Unsize<U>, U: ?Sized> DispatchFromDyn<MyPointer<U>> for MyPointer<T> {}
|
||||
impl<T: ?Sized> Deref for MyPointer<T> {
|
||||
type Target = T;
|
||||
fn deref(&self) -> &T {
|
||||
unimplemented!()
|
||||
}
|
||||
}
|
||||
|
||||
pub trait Trait {
|
||||
fn foo(self: MyPointer<Self>) {}
|
||||
}
|
||||
|
||||
// make sure some usage of `<dyn Trait>::foo` makes it to codegen
|
||||
pub fn user() -> *const () {
|
||||
<dyn Trait>::foo as *const ()
|
||||
}
|
||||
37
tests/crashes/138707.rs
Normal file
37
tests/crashes/138707.rs
Normal file
|
|
@ -0,0 +1,37 @@
|
|||
//@ known-bug: #138707
|
||||
//@edition:2024
|
||||
//@compile-flags: --crate-type lib
|
||||
use core::marker::PhantomData;
|
||||
|
||||
struct LeftReflector<S> {
|
||||
_phantom: PhantomData<S>,
|
||||
}
|
||||
|
||||
struct DefaultAllocator {}
|
||||
|
||||
trait Allocator<R> {
|
||||
type Buffer;
|
||||
}
|
||||
|
||||
struct U2 {}
|
||||
|
||||
impl Allocator<U2> for DefaultAllocator {
|
||||
type Buffer = [u8; 2];
|
||||
}
|
||||
|
||||
impl<R> From<R> for LeftReflector<<DefaultAllocator as Allocator<R>>::Buffer>
|
||||
where
|
||||
DefaultAllocator: Allocator<R>,
|
||||
{
|
||||
fn from(_: R) -> Self {
|
||||
todo!()
|
||||
}
|
||||
}
|
||||
|
||||
fn ice<D>(a: U2)
|
||||
where
|
||||
DefaultAllocator: Allocator<D>,
|
||||
{
|
||||
// ICE
|
||||
let _ = LeftReflector::from(a);
|
||||
}
|
||||
7
tests/crashes/138738.rs
Normal file
7
tests/crashes/138738.rs
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
//@ known-bug: #138738
|
||||
//@ only-x86_64
|
||||
|
||||
#![feature(abi_ptx)]
|
||||
fn main() {
|
||||
let a = unsafe { core::mem::transmute::<usize, extern "ptx-kernel" fn(i32)>(4) }(2);
|
||||
}
|
||||
2
tests/crashes/139089.rs
Normal file
2
tests/crashes/139089.rs
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
//@ known-bug: #139089
|
||||
pub fn foo3(x: &Vec<u8>) { x.push(0); }
|
||||
29
tests/crashes/139120.rs
Normal file
29
tests/crashes/139120.rs
Normal file
|
|
@ -0,0 +1,29 @@
|
|||
//@ known-bug: #139120
|
||||
|
||||
|
||||
|
||||
pub trait Foo {
|
||||
type Bar<'a>;
|
||||
}
|
||||
|
||||
pub struct FooImpl {}
|
||||
|
||||
impl Foo for FooImpl {
|
||||
type Bar<'a> = ();
|
||||
}
|
||||
|
||||
pub trait FooFn {
|
||||
fn bar(&self);
|
||||
}
|
||||
|
||||
impl<T: Foo> FooFn for fn(T, T::Bar<'_>) {
|
||||
fn bar(&self) {}
|
||||
}
|
||||
|
||||
fn foo<T: Foo>(f: fn(T, T::Bar<'_>)) {
|
||||
let _: &dyn FooFn = &f;
|
||||
}
|
||||
|
||||
fn main() {
|
||||
foo(|_: FooImpl, _| {});
|
||||
}
|
||||
13
tests/crashes/139381.rs
Normal file
13
tests/crashes/139381.rs
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
//@ known-bug: #139381
|
||||
//@ needs-rustc-debug-assertions
|
||||
trait A<'a> {
|
||||
type Assoc: ?Sized;
|
||||
}
|
||||
|
||||
impl<'a> A<'a> for () {
|
||||
type Assoc = &'a ();
|
||||
}
|
||||
|
||||
fn hello() -> impl for<'a> A<'a, Assoc: Into<u8> + 'static + Copy> {
|
||||
()
|
||||
}
|
||||
15
tests/crashes/139387.rs
Normal file
15
tests/crashes/139387.rs
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
//@ known-bug: #139387
|
||||
//@ needs-rustc-debug-assertions
|
||||
|
||||
trait A {
|
||||
fn method() -> impl Sized;
|
||||
}
|
||||
trait B {
|
||||
fn method(Hash: Wrap<impl Beta<U: Copy + for<'a> Epsilon<'_, SI1: Eta>>>) -> impl Sized;
|
||||
}
|
||||
|
||||
fn ambiguous<T: A + B>()
|
||||
where
|
||||
T::method(..): Send,
|
||||
{
|
||||
}
|
||||
12
tests/crashes/139409.rs
Normal file
12
tests/crashes/139409.rs
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
//@ known-bug: #139409
|
||||
//@ compile-flags: -Znext-solver=globally
|
||||
|
||||
fn main() {
|
||||
trait B<C> {}
|
||||
impl<C> B<C> for () {}
|
||||
trait D<C, E>: B<C> + B<E> {
|
||||
fn f(&self) {}
|
||||
}
|
||||
impl<C, E> D<C, E> for () {}
|
||||
(&() as &dyn D<&(), &()>).f()
|
||||
}
|
||||
8
tests/crashes/139462.rs
Normal file
8
tests/crashes/139462.rs
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
//@ known-bug: #139462
|
||||
//@ compile-flags: -Cdebuginfo=2
|
||||
#![feature(unsafe_binders)]
|
||||
use std::unsafe_binder::wrap_binder;
|
||||
fn main() {
|
||||
let foo = 0;
|
||||
let foo: unsafe<'a> &'a u32 = unsafe { wrap_binder!(&foo) };
|
||||
}
|
||||
13
tests/crashes/139556.rs
Normal file
13
tests/crashes/139556.rs
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
//@ known-bug: #139556
|
||||
|
||||
trait T {}
|
||||
|
||||
type Alias<'a> = impl T;
|
||||
|
||||
struct S;
|
||||
impl<'a> T for &'a S {}
|
||||
|
||||
#[define_opaque(Alias)]
|
||||
fn with_positive(fun: impl Fn(Alias<'_>)) {
|
||||
with_positive(|&n| ());
|
||||
}
|
||||
4
tests/crashes/139570.rs
Normal file
4
tests/crashes/139570.rs
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
//@ known-bug: #139570
|
||||
fn main() {
|
||||
|(1, 42), ()| yield;
|
||||
}
|
||||
10
tests/crashes/139596.rs
Normal file
10
tests/crashes/139596.rs
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
//@ known-bug: #139596
|
||||
|
||||
#![feature(min_generic_const_args)]
|
||||
struct Colour;
|
||||
|
||||
struct Led<const C: Colour>;
|
||||
|
||||
fn main() {
|
||||
Led::<{ Colour}>;
|
||||
}
|
||||
29
tests/crashes/139659.rs
Normal file
29
tests/crashes/139659.rs
Normal file
|
|
@ -0,0 +1,29 @@
|
|||
//@ known-bug: #139659
|
||||
//@compile-flags: -Cdebuginfo=2 -Copt-level=0 --crate-type lib
|
||||
trait Trait {
|
||||
type Output;
|
||||
}
|
||||
|
||||
impl<O, F: Fn() -> O> Trait for F {
|
||||
type Output = O;
|
||||
}
|
||||
|
||||
struct Wrap<P>(P);
|
||||
struct WrapOutput<O>(O);
|
||||
|
||||
impl<P: Trait> Trait for Wrap<P> {
|
||||
type Output = WrapOutput<P::Output>;
|
||||
}
|
||||
|
||||
fn wrap<P: Trait>(x: P) -> impl Trait {
|
||||
Wrap(x)
|
||||
}
|
||||
|
||||
fn consume<P: Trait>(_: P) -> P::Output {
|
||||
unimplemented!()
|
||||
}
|
||||
|
||||
pub fn recurse() -> impl Sized {
|
||||
consume(wrap(recurse))
|
||||
}
|
||||
pub fn main() {}
|
||||
3
tests/crashes/139738.rs
Normal file
3
tests/crashes/139738.rs
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
//@ known-bug: #139738
|
||||
#![feature(generic_const_exprs)]
|
||||
fn b<'a>() -> impl IntoIterator<[(); (|_: &'a u8| 0, 0).1]> {}
|
||||
14
tests/crashes/139815.rs
Normal file
14
tests/crashes/139815.rs
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
//@ known-bug: #139815
|
||||
|
||||
#![feature(generic_const_exprs)]
|
||||
fn is_123<const N: usize>(
|
||||
x: [u32; {
|
||||
N + 1;
|
||||
5
|
||||
}],
|
||||
) -> bool {
|
||||
match x {
|
||||
[1, 2] => true,
|
||||
_ => false,
|
||||
}
|
||||
}
|
||||
8
tests/crashes/139817.rs
Normal file
8
tests/crashes/139817.rs
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
//@ known-bug: #139817
|
||||
fn enum_upvar() {
|
||||
type T = impl Copy;
|
||||
let foo: T = Some((42, std::marker::PhantomData::<T>));
|
||||
let x = move || match foo {
|
||||
None => (),
|
||||
};
|
||||
}
|
||||
5
tests/crashes/139825.rs
Normal file
5
tests/crashes/139825.rs
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
//@ known-bug: #139825
|
||||
//@compile-flags: --check-cfg=cfg(docsrs,test) --crate-type lib
|
||||
struct a
|
||||
where
|
||||
for<#[cfg(b)] c> u8:;
|
||||
Loading…
Add table
Add a link
Reference in a new issue