diff --git a/tests/crashes/123664.rs b/tests/crashes/123664.rs new file mode 100644 index 0000000000000..80c415fe07bd7 --- /dev/null +++ b/tests/crashes/123664.rs @@ -0,0 +1,4 @@ +//@ known-bug: #123664 +#![feature(generic_const_exprs, effects)] +const fn with_positive() {} +pub fn main() {} diff --git a/tests/crashes/123955.rs b/tests/crashes/123955.rs new file mode 100644 index 0000000000000..fdd58c84794cf --- /dev/null +++ b/tests/crashes/123955.rs @@ -0,0 +1,6 @@ +//@ known-bug: #123955 +//@ compile-flags: -Clto -Zvirtual-function-elimination +//@ only-x86_64 +pub fn main() { + _ = Box::new(()) as Box; +} diff --git a/tests/crashes/124092.rs b/tests/crashes/124092.rs new file mode 100644 index 0000000000000..c03db384e76ea --- /dev/null +++ b/tests/crashes/124092.rs @@ -0,0 +1,7 @@ +//@ known-bug: #124092 +//@ compile-flags: -Zvirtual-function-elimination=true -Clto=true +//@ only-x86_64 +const X: for<'b> fn(&'b ()) = |&()| (); +fn main() { + let dyn_debug = Box::new(X) as Box as Box; +} diff --git a/tests/crashes/124182.rs b/tests/crashes/124182.rs new file mode 100644 index 0000000000000..46948207df381 --- /dev/null +++ b/tests/crashes/124182.rs @@ -0,0 +1,22 @@ +//@ known-bug: #124182 +struct LazyLock { + data: (Copy, fn() -> T), +} + +impl LazyLock { + pub const fn new(f: fn() -> T) -> LazyLock { + LazyLock { data: (None, f) } + } +} + +struct A(Option); + +impl Default for A { + fn default() -> Self { + A(None) + } +} + +static EMPTY_SET: LazyLock> = LazyLock::new(A::default); + +fn main() {} diff --git a/tests/crashes/124189.rs b/tests/crashes/124189.rs new file mode 100644 index 0000000000000..7c193ec1bce85 --- /dev/null +++ b/tests/crashes/124189.rs @@ -0,0 +1,14 @@ +//@ known-bug: #124189 +trait Trait { + type Type; +} + +impl Trait for T { + type Type = (); +} + +fn f(_: <&Copy as Trait>::Type) {} + +fn main() { + f(()); +} diff --git a/tests/crashes/124207.rs b/tests/crashes/124207.rs new file mode 100644 index 0000000000000..a4e1c55189006 --- /dev/null +++ b/tests/crashes/124207.rs @@ -0,0 +1,9 @@ +//@ known-bug: #124207 +#![feature(transmutability)] +#![feature(type_alias_impl_trait)] +trait OpaqueTrait {} +type OpaqueType = impl OpaqueTrait; +trait AnotherTrait {} +impl> AnotherTrait for T {} +impl AnotherTrait for OpaqueType {} +pub fn main() {}