Skip to content

Commit

Permalink
Rollup merge of rust-lang#129782 - matthiaskrgr:c, r=jieyouxu
Browse files Browse the repository at this point in the history
couple more crash tests

r? `@jieyouxu`
  • Loading branch information
workingjubilee authored Aug 31, 2024
2 parents bc90926 + 355d7c9 commit 651bddc
Show file tree
Hide file tree
Showing 4 changed files with 54 additions and 0 deletions.
6 changes: 6 additions & 0 deletions tests/crashes/129425.rs
Original file line number Diff line number Diff line change
@@ -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)]) {}
15 changes: 15 additions & 0 deletions tests/crashes/129444.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
//@ known-bug: rust-lang/rust#129444

//@ compile-flags: -Znext-solver=coherence

trait Trait {
type Assoc;
}

struct W<T: Trait>(*mut T);
impl<T: ?Trait> Trait for W<W<W<T>>> {}

trait NoOverlap {}
impl<T: Trait<W<T>>> NoOverlap for T {}

impl<T: Trait<Assoc = u32>> NoOverlap for W<T> {}
7 changes: 7 additions & 0 deletions tests/crashes/129503.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
//@ known-bug: rust-lang/rust#129503

use std::arch::asm;

unsafe fn f6() {
asm!(concat!(r#"lJ𐏿Æ�.𐏿�"#, "r} {}"));
}
26 changes: 26 additions & 0 deletions tests/crashes/129556.rs
Original file line number Diff line number Diff line change
@@ -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<const SMTH: StructOrEnum = { StructOrEnum::A }> {}

trait TraitChild<const SMTH: StructOrEnum = { StructOrEnum::A }>: TraitParent<SMTH> {}

impl TraitParent for StructOrEnum {}

// ICE occurs
impl TraitChild for StructOrEnum {}

// ICE does not occur
// impl TraitChild<{ StructOrEnum::A }> for StructOrEnum {}

0 comments on commit 651bddc

Please sign in to comment.