Skip to content

Commit

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

r? `@jieyouxu`

try-job: aarch64-apple
try-job: x86_64-msvc
  • Loading branch information
bors committed Dec 12, 2024
2 parents a94fce9 + 33e6be0 commit 1f04caa
Show file tree
Hide file tree
Showing 10 changed files with 113 additions and 0 deletions.
12 changes: 12 additions & 0 deletions tests/crashes/132765.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
//@ known-bug: #132765

trait LendingIterator {
type Item<'q>;
fn for_each(&self, _f: Box<fn(Self::Item<'_>)>) {}
}

fn f(_: ()) {}

fn main() {
LendingIterator::for_each(&(), f);
}
9 changes: 9 additions & 0 deletions tests/crashes/132766.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
//@ known-bug: #132766

trait Trait {}
impl<'a> Trait for () {
fn pass2<'a>() -> impl Trait2 {}
}

trait Trait2 {}
impl Trait2 for () {}
13 changes: 13 additions & 0 deletions tests/crashes/132882.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
//@ known-bug: #132882

use std::ops::Add;

pub trait Numoid
where
for<N: Numoid> &'a Self: Add<Self>,
{
}

pub fn compute<N: Numoid>(a: N) -> N {
&a + a
}
7 changes: 7 additions & 0 deletions tests/crashes/132981.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
//@ known-bug: #132981
//@compile-flags: -Clink-dead-code=true --crate-type lib
//@ only-x86_64
//@ ignore-windows

#![feature(rust_cold_cc)]
pub extern "rust-cold" fn foo(_: [usize; 3]) {}
8 changes: 8 additions & 0 deletions tests/crashes/133063.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
//@ known-bug: #133063

fn foo(x: !) {
match x {
(! | !) if false => {}
_ => {}
}
}
12 changes: 12 additions & 0 deletions tests/crashes/133066.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
//@ known-bug: #133066
trait Owner {
const C<const N: u32>: u32;
}

impl Owner for () {;}

fn take0<const N: u64>(_: impl Owner<C<N> = { N }>) {}

fn main() {
take0::<f32, >(());
}
11 changes: 11 additions & 0 deletions tests/crashes/133199.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
//@ known-bug: #133199
//@ aux-build: aux133199.rs

extern crate aux133199;

use aux133199::FixedBitSet;

fn main() {
FixedBitSet::<7>::new();
//~^ ERROR
}
13 changes: 13 additions & 0 deletions tests/crashes/133275-1.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
//@ known-bug: #133275
#![feature(const_trait_impl)]
#![feature(associated_type_defaults)]

#[const_trait]
trait Foo3<T>
where
Self::Baz: Clone,
{
type Baz = T;
}

pub fn main() {}
15 changes: 15 additions & 0 deletions tests/crashes/133275-2.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
//@ known-bug: #133275
#![feature(const_trait_impl)]
#[const_trait]
pub trait Owo<X = <IntEnum as Uwu>::T> {}

#[const_trait]
trait Foo3<T>
where
Self::Bar: Clone,
Self::Baz: Clone,
{
type Bar = Vec<Self::Baz>;
type Baz = T;
//~^ ERROR the trait bound `T: Clone` is not satisfied
}
13 changes: 13 additions & 0 deletions tests/crashes/auxiliary/aux133199.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#![allow(incomplete_features)]
#![feature(generic_const_exprs)]

pub struct FixedBitSet<const N: usize>;

impl<const N: usize> FixedBitSet<N>
where
[u8; N.div_ceil(8)]: Sized,
{
pub fn new() -> Self {
todo!()
}
}

0 comments on commit 1f04caa

Please sign in to comment.