diff --git a/tests/crashes/126062.rs b/tests/crashes/126062.rs new file mode 100644 index 00000000000..9f1bec1d46e --- /dev/null +++ b/tests/crashes/126062.rs @@ -0,0 +1,11 @@ +//@ known-bug: rust-lang/rust#126062 +struct Fail(Fail); +impl Fail { + const C: () = panic!(); +} + +fn f() { + if false { + let _val = &Fail::::C; + } +} diff --git a/tests/crashes/126148.rs b/tests/crashes/126148.rs new file mode 100644 index 00000000000..79f8887b401 --- /dev/null +++ b/tests/crashes/126148.rs @@ -0,0 +1,23 @@ +//@ known-bug: rust-lang/rust#126148 + +#![feature(effects)] +use std::ops::{FromResidual, Try}; + +struct TryMe; +struct Error; + +impl const FromResidual for TryMe {} + +impl const Try for TryMe { + type Output = (); + type Residual = Error; +} + +const fn t() -> TryMe { + TryMe?; + TryMe +} + +const _: () = { + t(); +}; diff --git a/tests/crashes/126182.rs b/tests/crashes/126182.rs new file mode 100644 index 00000000000..2219a6cb5fa --- /dev/null +++ b/tests/crashes/126182.rs @@ -0,0 +1,10 @@ +//@ known-bug: rust-lang/rust#126182 + +#![feature(generic_const_exprs)] +#![allow(incomplete_features)] + +struct Cond; + +struct Thing>(T); + +impl Thing {} diff --git a/tests/crashes/126267.rs b/tests/crashes/126267.rs new file mode 100644 index 00000000000..c0604b90a67 --- /dev/null +++ b/tests/crashes/126267.rs @@ -0,0 +1,30 @@ +//@ known-bug: rust-lang/rust#126267 + +#![feature(transmutability)] +#![crate_type = "lib"] + +pub enum ApiError {} +pub struct TokioError { + b: bool, +} +pub enum Error { + Api { source: ApiError }, + Ethereum, + Tokio { source: TokioError }, +} + +mod assert { + use std::mem::BikeshedIntrinsicFrom; + + pub fn is_transmutable() + where + Dst: BikeshedIntrinsicFrom, // safety is NOT assumed + { + } +} + +fn test() { + struct Src; + type Dst = Error; + assert::is_transmutable::(); +} diff --git a/tests/crashes/126269.rs b/tests/crashes/126269.rs new file mode 100644 index 00000000000..ca4b76eb930 --- /dev/null +++ b/tests/crashes/126269.rs @@ -0,0 +1,12 @@ +//@ known-bug: rust-lang/rust#126269 +#![feature(coerce_unsized)] + +pub enum Foo { + Bar([T; usize::MAX]), +} + +use std::ops::CoerceUnsized; + +impl CoerceUnsized for T {} + +fn main() {} diff --git a/tests/crashes/126272.rs b/tests/crashes/126272.rs new file mode 100644 index 00000000000..3412c7d8f0f --- /dev/null +++ b/tests/crashes/126272.rs @@ -0,0 +1,28 @@ +//@ known-bug: rust-lang/rust#126272 + +#![feature(adt_const_params)] +#![allow(incomplete_features)] + +use std::marker::ConstParamTy; + +#[derive(Debug, PartialEq, Eq, ConstParamTy)] +struct Foo { + value: i32, + nested: &'static Bar, +} + +#[derive(Debug, PartialEq, Eq, ConstParamTy)] +struct Bar(T); + +struct Test; + +fn main() { + let x: Test< + { + Foo { + value: 3, + nested: &Bar(4), + } + }, + > = Test; +} diff --git a/tests/crashes/126359.rs b/tests/crashes/126359.rs new file mode 100644 index 00000000000..4b28c466b55 --- /dev/null +++ b/tests/crashes/126359.rs @@ -0,0 +1,9 @@ +//@ known-bug: rust-lang/rust#126359 + +struct OppOrder { + arr: [T; N], +} + +fn main() { + let _ = OppOrder::<3, u32> { arr: [0, 0, 0] }; +} diff --git a/tests/crashes/126376.rs b/tests/crashes/126376.rs new file mode 100644 index 00000000000..028dde6d438 --- /dev/null +++ b/tests/crashes/126376.rs @@ -0,0 +1,14 @@ +//@ known-bug: rust-lang/rust#126376 +mod a { + pub mod b { + pub mod c { + pub trait D {} + } + } +} + +use a::*; +use e as b; +use b::c::D as e; + +fn e() {} diff --git a/tests/crashes/126377.rs b/tests/crashes/126377.rs new file mode 100644 index 00000000000..f8b9b693b65 --- /dev/null +++ b/tests/crashes/126377.rs @@ -0,0 +1,29 @@ +//@ known-bug: rust-lang/rust#126377 + +#![feature(effects)] +#![feature(generic_const_exprs)] + +mod assert { + use std::mem::{Assume, BikeshedIntrinsicFrom}; + + pub fn is_transmutable< + Src, + Dst, + const ASSUME_ALIGNMENT: bool, + const ASSUME_LIFETIMES: bool, + const ASSUME_SAFETY: bool, + const ASSUME_VALIDITY: bool, + >() + where + Dst: BikeshedIntrinsicFrom< + Src, + { } + >, + {} +} + +const fn from_options() -> Assume { + #[repr(C)] struct Src; + #[repr(C)] struct Dst; + assert::is_transmutable::(); +} diff --git a/tests/crashes/126385.rs b/tests/crashes/126385.rs new file mode 100644 index 00000000000..9e74e88c1ff --- /dev/null +++ b/tests/crashes/126385.rs @@ -0,0 +1,10 @@ +//@ known-bug: rust-lang/rust#126385 +pub struct MyStruct<'field> { + field: &'_ [u32], +} + +impl MyStruct<'_> { + pub fn _<'a>(field: &'a[u32]) -> Self { + Self{field} + } +} diff --git a/tests/crashes/126389.rs b/tests/crashes/126389.rs new file mode 100644 index 00000000000..7aa6ecad9a3 --- /dev/null +++ b/tests/crashes/126389.rs @@ -0,0 +1,15 @@ +//@ known-bug: rust-lang/rust#126389 + +mod a { + pub mod b { + pub mod c {} + } +} + +use a::*; + +use b::c; + +use c as b; + +fn c() {} diff --git a/tests/crashes/126416.rs b/tests/crashes/126416.rs new file mode 100644 index 00000000000..9b6c5169d44 --- /dev/null +++ b/tests/crashes/126416.rs @@ -0,0 +1,20 @@ +//@ known-bug: rust-lang/rust#126416 + +trait Output<'a, T: 'a> { + type Type; +} + +struct Wrapper; + +impl Wrapper { + fn do_something_wrapper(&mut self, _: F) + where + F: for<'a> FnOnce(>::Type), + { + } +} + +fn main() { + let mut wrapper = Wrapper; + wrapper.do_something_wrapper(|value| ()); +} diff --git a/tests/crashes/126521.rs b/tests/crashes/126521.rs new file mode 100644 index 00000000000..0a025aabcf2 --- /dev/null +++ b/tests/crashes/126521.rs @@ -0,0 +1,11 @@ +//@ known-bug: rust-lang/rust#126521 +macro_rules! foo { + ($val:ident) => { + true; + }; +} + +fn main() { + #[expect(semicolon_in_expressions_from_macros)] + let _ = foo!(x); +}