-
-
Notifications
You must be signed in to change notification settings - Fork 14.2k
crashes: more tests #147857
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
crashes: more tests #147857
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| 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() {} |
| 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 {} | ||
| } |
| 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; | ||
| } |
| 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(); | ||
| } |
| 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() {} | ||
| 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() {} |
| 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() {} |
| 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 | ||
| }; |
| 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() {} |
| 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() {} |
| 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() {} |
| 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)]; | ||
| } |
| 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() {} |
| 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; | ||
| } |
| 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<()>>(); | ||
| } |
| 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() {} |
| 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.. |
| 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() {} |
| 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; | ||
| } |
| 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() {} |
| 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::<{}> }>() }>>(); |
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Suggestion: fmease has an MCVE #143498 (comment), so I rather not add this version with a ton of feature gates...
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. eh, not in the mood for dealing with aux/flags stuff right now .. :) |
| 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() {} |
| 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>(); | ||
| } |
| 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(); | ||
| } |
| 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, | ||
| } | ||
| } | ||
| } | ||
| } |
| 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 | ||
| } | ||
| } |
| 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() {} |
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Question: does it make sense to add a crashes test for an incomplete feature? I don't think this would be particularly useful, since the people working said feature is already aware of the ICE.