From 355d7c9ecda6dbb63812aafb744873f6bc9c5e7d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matthias=20Kr=C3=BCger?= Date: Fri, 30 Aug 2024 12:38:22 +0200 Subject: [PATCH] couple more crash tests --- tests/crashes/129425.rs | 6 ++++++ tests/crashes/129444.rs | 15 +++++++++++++++ tests/crashes/129503.rs | 7 +++++++ tests/crashes/129556.rs | 26 ++++++++++++++++++++++++++ 4 files changed, 54 insertions(+) create mode 100644 tests/crashes/129425.rs create mode 100644 tests/crashes/129444.rs create mode 100644 tests/crashes/129503.rs create mode 100644 tests/crashes/129556.rs diff --git a/tests/crashes/129425.rs b/tests/crashes/129425.rs new file mode 100644 index 0000000000000..ac7dc0078474d --- /dev/null +++ b/tests/crashes/129425.rs @@ -0,0 +1,6 @@ +//@ known-bug: rust-lang/rust#129425 + +//@compile-flags: --crate-type=lib + +#![feature(generic_const_exprs)] +fn foo<'a, T: 'a>(_: [(); std::mem::offset_of!((T,), 0)]) {} diff --git a/tests/crashes/129444.rs b/tests/crashes/129444.rs new file mode 100644 index 0000000000000..b1b547b5191bd --- /dev/null +++ b/tests/crashes/129444.rs @@ -0,0 +1,15 @@ +//@ known-bug: rust-lang/rust#129444 + +//@ compile-flags: -Znext-solver=coherence + +trait Trait { + type Assoc; +} + +struct W(*mut T); +impl Trait for W>> {} + +trait NoOverlap {} +impl>> NoOverlap for T {} + +impl> NoOverlap for W {} diff --git a/tests/crashes/129503.rs b/tests/crashes/129503.rs new file mode 100644 index 0000000000000..c1ed46e595570 --- /dev/null +++ b/tests/crashes/129503.rs @@ -0,0 +1,7 @@ +//@ known-bug: rust-lang/rust#129503 + +use std::arch::asm; + +unsafe fn f6() { + asm!(concat!(r#"lJ𐏿Æ�.𐏿�"#, "r} {}")); +} diff --git a/tests/crashes/129556.rs b/tests/crashes/129556.rs new file mode 100644 index 0000000000000..364827e9444f6 --- /dev/null +++ b/tests/crashes/129556.rs @@ -0,0 +1,26 @@ +//@ known-bug: rust-lang/rust#129556 + +#![feature(adt_const_params)] +#![feature(generic_const_exprs)] + +use core::marker::ConstParamTy; + +// #[derive(ConstParamTy, PartialEq, Eq)] +// struct StructOrEnum; + +#[derive(ConstParamTy, PartialEq, Eq)] +enum StructOrEnum { + A, +} + +trait TraitParent {} + +trait TraitChild: TraitParent {} + +impl TraitParent for StructOrEnum {} + +// ICE occurs +impl TraitChild for StructOrEnum {} + +// ICE does not occur +// impl TraitChild<{ StructOrEnum::A }> for StructOrEnum {}