Skip to content

Commit

Permalink
Auto merge of rust-lang#134236 - matthiaskrgr:tests12122024, r=<try>
Browse files Browse the repository at this point in the history
crashes: more tests v2

try-job: aarch64-apple
try-job: x86_64-msvc
try-job: x86_64-gnu
  • Loading branch information
bors committed Dec 12, 2024
2 parents d4025ee + 7880aba commit 98a1cdd
Show file tree
Hide file tree
Showing 11 changed files with 122 additions and 0 deletions.
12 changes: 12 additions & 0 deletions tests/crashes/133426.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
//@ known-bug: #133426

fn a(
_: impl Iterator<
Item = [(); {
match *todo!() { ! };
}],
>,
) {
}

fn b(_: impl Iterator<Item = { match 0 { ! } }>) {}
11 changes: 11 additions & 0 deletions tests/crashes/133597.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
//@ known-bug: #133597

pub trait Foo2 {
fn boxed<'a: 'a>() -> impl Sized + FnOnce<()>;
}

impl Foo2 for () {}


fn f() -> impl FnOnce<()> { || () }
fn main() { () = f(); }
33 changes: 33 additions & 0 deletions tests/crashes/133639.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
//@ known-bug: #133639

#![feature(with_negative_coherence)]
#![feature(min_specialization)]
#![feature(generic_const_exprs)]

#![crate_type = "lib"]
use std::str::FromStr;

struct a<const b: bool>;

trait c {}

impl<const d: u32> FromStr for e<d>
where
a<{ d <= 2 }>: c,
{
type Err = ();
fn from_str(f: &str) -> Result<Self, Self::Err> {
unimplemented!()
}
}
struct e<const d: u32>;

impl<const d: u32> FromStr for e<d>
where
a<{ d <= 2 }>: c,
{
type Err = ();
fn from_str(f: &str) -> Result<Self, Self::Err> {
unimplemented!()
}
}
15 changes: 15 additions & 0 deletions tests/crashes/133808.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
//@ known-bug: #133808

#![feature(generic_const_exprs, transmutability)]

mod assert {
use std::mem::TransmuteFrom;

pub fn is_transmutable<Src, Dst>()
where
Dst: TransmuteFrom<Src>,
{
}
}

pub fn main() {}
13 changes: 13 additions & 0 deletions tests/crashes/133868.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
//@ known-bug: #133868

trait Foo {
type Assoc;
}

trait Bar {
fn method() -> impl Sized;
}
impl<T> Bar for T where <T as Foo>::Assoc: Sized
{
fn method() {}
}
9 changes: 9 additions & 0 deletions tests/crashes/133965.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
//@ known-bug: #133965
//@ needs-rustc-debug-assertions

struct NonGeneric {}

#[derive(Default)]
struct NonGeneric<'a, const N: usize> {}

pub fn main() {}
3 changes: 3 additions & 0 deletions tests/crashes/133966.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
//@ known-bug: #133966
pub struct Data([[&'static str]; 5_i32]);
const _: &'static Data = unsafe { &*(&[] as *const Data) };
5 changes: 5 additions & 0 deletions tests/crashes/134005.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
//@ known-bug: #134005

fn main() {
let _ = [std::ops::Add::add, std::ops::Mul::mul, main as fn(_, &_)];
}
4 changes: 4 additions & 0 deletions tests/crashes/134061.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
//@ known-bug: #134061
//@ needs-rustc-debug-assertions

const x: () = |&'a
8 changes: 8 additions & 0 deletions tests/crashes/134162.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
//@ known-bug: #134162

fn main() {
struct X;

let xs = [X, X, X];
let eq = xs == [panic!("panic evaluated"); 2];
}
9 changes: 9 additions & 0 deletions tests/crashes/134217.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
//@ known-bug: #134217

impl<A> std::ops::CoerceUnsized<A> for A {}

fn main() {
if let _ = true
&& true
{}
}

0 comments on commit 98a1cdd

Please sign in to comment.