Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

crashes: more tests v2 #134236

Merged
merged 1 commit into from
Dec 14, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
{}
}
Loading