Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions tests/crashes/141293.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
//@ known-bug: rust-lang/rust#141293
#![feature(unsafe_binders)]
type X = unsafe<T> ();

type Y = unsafe<const N: i32> ();

pub fn main() {}
11 changes: 11 additions & 0 deletions tests/crashes/141380.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
//@ known-bug: rust-lang/rust#141380
trait Trait<T> {}
type Alias<P: Trait> = impl Trait<U>;

pub enum UninhabitedVariants {
Tuple(Alias),
}

fn uwu(x: UninhabitedVariants) {
match x {}
}
24 changes: 24 additions & 0 deletions tests/crashes/141850.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
//@ known-bug: rust-lang/rust#141850
//@edition: 2024
//@ compile-flags: -Copt-level=0
#![feature(pin_ergonomics)]
async fn a() {
wrapper_call(handler).await;
}
async fn wrapper_call<F>(_: F) -> F::Output
where
F: Handler,
{
todo!()
}
async fn handler();
trait Handler {
type Output;
}
impl<Func, Fut> Handler for Func
where
Func: Fn() -> Fut,
Fut: Future,
{
type Output = Fut;
}
15 changes: 15 additions & 0 deletions tests/crashes/141911.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
//@ known-bug: rust-lang/rust#141911
trait MyTrait {
fn virtualize(&self);
}
struct VirtualWrapper<T>(T, T);

impl<T: 'static> MyTrait for T {
fn virtualize(&self) {
const { std::ptr::null::<VirtualWrapper<T>>() as *const dyn MyTrait };
}
}

fn main() {
0u8.virtualize();
}
18 changes: 18 additions & 0 deletions tests/crashes/141916.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
//@ known-bug: rust-lang/rust#141916
//@ edition: 2024
#![allow(incomplete_features)]
#![feature(ergonomic_clones)]

use std::clone::UseCloned;

#[derive(Clone)]
struct Foo;

impl UseCloned for Foo {}

fn do_not_move_test(x: Foo) -> Foo { async {
let s = x.use;
x
} }

fn main() {}
13 changes: 13 additions & 0 deletions tests/crashes/142155.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
//@ known-bug: rust-lang/rust#142155
//@ needs-rustc-debug-assertions
//@ edition:2021

#![warn(tail_expr_drop_order)]
use core::future::Future;
use core::pin::Pin;

fn wrapped_fn<'a>() -> Pin<Box<(dyn Future<Output = Result<Box<()>, String>> + Send + 'static)>> {
Box::pin(async { Err("nope".into()) })
}

pub fn main() {}
11 changes: 11 additions & 0 deletions tests/crashes/142209.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
//@ known-bug: rust-lang/rust#142209
#![feature(generic_const_exprs)]

struct Bar<const X: usize>;
const FRAC_LHS: usize = 0;

trait Foo<const N: usize> {}

impl<const N: usize = { const { 3 } }> PartialEq<dyn Foo<FRAC_LHS>> for Bar<KABOOM> {}

pub fn main() {}
7 changes: 7 additions & 0 deletions tests/crashes/142229.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
//@ known-bug: rust-lang/rust#142229
#![feature(super_let)]

const _: *const i32 = {
super let x = 1;
&raw const x
};
10 changes: 10 additions & 0 deletions tests/crashes/142382.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
//@ known-bug: rust-lang/rust#142382

#![feature(generic_const_parameter_types)]
#![feature(adt_const_params)]
#![feature(unsized_const_params)]

struct Bar<'a, const N: &'a u32>;
fn foo(&self) -> Bar<0> { todo!(); }

pub fn main() {}
4 changes: 4 additions & 0 deletions tests/crashes/142529.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
//@ known-bug: rust-lang/rust#142529
#![feature(min_generic_const_args)]
struct Foo<T, U = [u8; size_of::<T>]>(T, U);
fn main() {}
14 changes: 14 additions & 0 deletions tests/crashes/142559.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
//@ known-bug: rust-lang/rust#142559
//@ edition: 2024
//@ compile-flags: -Copt-level=0 -Clink-dead-code=true

#![feature(async_drop)]
async fn test<Fut: Future>(operation: impl Fn() -> Fut) {
operation().await;
}

pub async fn orchestrate_simple_crud() {
test(async || async {}.await).await;
}

fn main() {}
24 changes: 24 additions & 0 deletions tests/crashes/142560.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
//@ known-bug: rust-lang/rust#142560
//@ edition:2021
//@ compile-flags: -Zlint-mir
#![feature(async_drop)]
use std::{future::AsyncDrop, pin::Pin};
struct Foo {
my_resource_handle: usize,
}
impl Foo {
fn new(my_resource_handle: usize) -> Self {
let out = Foo { my_resource_handle };
out
}
}
impl Drop for Foo {
fn drop(&mut self) {}
}
impl AsyncDrop for Foo {
async fn drop(self: Pin<&mut Self>) {}
}
fn main() {}
async fn bar() {
[Foo::new(3)];
}
11 changes: 11 additions & 0 deletions tests/crashes/142717.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
//@ known-bug: rust-lang/rust#142717
#![feature(inherent_associated_types)]
struct Foo<T>(T);

impl<'a> Foo<fn(&'a ())> {
type Assoc = &mut Peekable<I>;
}

fn bar(_: for<'a> fn(Foo<fn(Foo<fn(&'a ())>::Assoc)>::Assoc)) {}

pub fn main() {}
11 changes: 11 additions & 0 deletions tests/crashes/142773.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
//@ known-bug: rust-lang/rust#142773
//@compile-flags: --crate-type=lib
#![feature(min_generic_const_args)]
#![feature(inherent_associated_types)]
pub struct EntriesBuffer(Box<[[u8; HashesEntry::LEN]; 5]>);

pub struct HashesEntry<'a>(&'a [u8]);

impl HashesEntry<'_> {
pub const LEN: usize = 1;
}
25 changes: 25 additions & 0 deletions tests/crashes/142866.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
//@ known-bug: rust-lang/rust#142866
//@ compile-flags: -Znext-solver=globally
trait Trait<T> {}
struct A<T>(T);
struct B<T>(T);

trait IncompleteGuidance {}

impl<T> Trait<()> for A<T>
where
T: IncompleteGuidance,
{
}

impl<T, U> Trait<()> for B<T>
where
A<T>: Trait<U>,
{
}

fn impls_trait<T: Trait<()>>() {}

fn main() {
impls_trait::<B<()>>();
}
7 changes: 7 additions & 0 deletions tests/crashes/142913.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
//@ known-bug: rust-lang/rust#142913
#![feature(generic_const_parameter_types)]
struct Variant;

fn foo<'a, const N: &'a Variant = {}>() {}

fn main() {}
42 changes: 42 additions & 0 deletions tests/crashes/143094.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
//@ known-bug: rust-lang/rust#143094
fn main() {
#[cold]
5
}

fn TokenStream() {
#[rustc_align(16)]
1u32
}

fn a() {
#[macro_use]
1
}

fn b() {
#[loop_match]
5
}

pub fn c() {
#[crate_name = "xcrate_issue_61711_b"]
0
}

pub fn d() {
fn k() {}
#[inline(always)]
|| -> fn() { k }
}

fn e() {
#[inline]
0
}

pub fn f() {
#[proc_macro_derive(Bleh)]
0
}
// etc..
8 changes: 8 additions & 0 deletions tests/crashes/143117.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
//@ known-bug: rust-lang/rust#143117
#![feature(generic_const_exprs)]
#![feature(generic_const_parameter_types)]
#![feature(adt_const_params)]
#[derive(Clone)]
struct Foo<const N : [u8; Self::FOO]>;

pub fn main() {}
6 changes: 6 additions & 0 deletions tests/crashes/143174.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
//@ known-bug: rust-lang/rust#143174
static FOO: &(u8, ) = &(BAR, );

unsafe extern "C" {
static BAR: u8;
}
8 changes: 8 additions & 0 deletions tests/crashes/143205.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
//@ known-bug: rust-lang/rust#143205
#![feature(generic_const_exprs)]

struct Bug<A = [(); (1).1]> {
a: Bug,
}

pub fn main() {}
4 changes: 4 additions & 0 deletions tests/crashes/143358.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
//@ known-bug: rust-lang/rust#143358
#![feature(generic_const_exprs)]
#![feature(min_generic_const_args)]
fn identity<const T: identity<{ identity::<{ identity::<{}> }>() }>>();
21 changes: 21 additions & 0 deletions tests/crashes/143498.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
//@ known-bug: rust-lang/rust#143498
#![feature(fn_delegation)]
#![feature(iter_advance_by)]
#![feature(iter_array_chunks)]
#![feature(iterator_try_collect)]
#![feature(iterator_try_reduce)]
#![feature(iter_collect_into)]
#![feature(iter_intersperse)]
#![feature(iter_is_partitioned)]
#![feature(iter_map_windows)]
#![feature(iter_next_chunk)]
#![feature(iter_order_by)]
#![feature(iter_partition_in_place)]
#![feature(trusted_random_access)]
#![feature(try_find)]
#![allow(incomplete_features)]
impl X {
reuse< std::fmt::Debug as Iterator >::*;
}

pub fn main() {}
10 changes: 10 additions & 0 deletions tests/crashes/143506.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
//@ known-bug: rust-lang/rust#143506
#![feature(generic_const_exprs)]
#![feature(min_generic_const_args)]
fn foo<const N: u32>(a: [(); N as usize]) {}

const C: f32 = 1.0;

fn main() {
foo::<C>();
}
5 changes: 5 additions & 0 deletions tests/crashes/143787.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
//@ known-bug: rust-lang/rust#143787
#![feature(stmt_expr_attributes)]
fn main() {
let _: fn(isize) -> usize = #[repr()] std::string::String::new();
}
17 changes: 17 additions & 0 deletions tests/crashes/143806.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
//@ known-bug: rust-lang/rust#143806
//@compile-flags: -Zlint-mir
#![feature(loop_match)]

fn main() {}

fn helper() -> u8 {
let mut state = 0u8;
#[loop_match]
'a: loop {
state = 'blk: {
match state {
_ => break 'blk state,
}
}
}
}
16 changes: 16 additions & 0 deletions tests/crashes/143872.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
//@ known-bug: rust-lang/rust#143872
//@ needs-rustc-debug-assertions
trait Project {
type Ty;
}
impl Project for &'_ &'static () {
type Ty = ();
}
trait Trait {
fn get<'s>(s: &'s str, _: ()) -> &'_ str;
}
impl Trait for () {
fn get<'s>(s: &'s str, _: <&&'s () as Project>::Ty) -> &'static str {
s
}
}
9 changes: 9 additions & 0 deletions tests/crashes/143896.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
//@ known-bug: rust-lang/rust#143896
#![feature(associated_const_equality)]
trait TraitA<'a> {
const K: usize = 0;
}
impl<T> TraitA<'_> for () {}
impl dyn TraitA<'_> where (): TraitA<'a,K = 0> {}

pub fn main() {}
Loading
Loading