Skip to content

more crash tests #130491

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

Merged
merged 1 commit into from
Sep 18, 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
19 changes: 19 additions & 0 deletions tests/crashes/120016.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
//@ known-bug: #120016
//@ compile-flags: -Zcrate-attr=feature(const_async_blocks) --edition=2021

#![feature(type_alias_impl_trait, const_async_blocks)]

struct Bug {
V1: [(); {
type F = impl std::future::Future<Output = impl Sized>;
fn concrete_use() -> F {
//~^ ERROR to be a future that resolves to `u8`, but it resolves to `()`
async {}
}
let f: F = async { 1 };
//~^ ERROR `async` blocks are not allowed in constants
1
}],
}

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

struct Thing;

pub trait Every {
type Assoc;
}
impl<T: ?Sized> Every for Thing {
type Assoc = T;
}

fn foo(_: <Thing as Every>::Assoc) {}
15 changes: 15 additions & 0 deletions tests/crashes/128119.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
//@ known-bug: #128119

trait Trait {
reuse to_reuse::foo { self }
}

struct S;

mod to_reuse {
pub fn foo(&self) -> u32 {}
}

impl Trait S {
reuse to_reuse::foo { self }
}
15 changes: 15 additions & 0 deletions tests/crashes/128232.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
//@ known-bug: #128232

#![feature(generic_const_exprs, unsized_const_params)]

fn function() {}

struct Wrapper<const F: fn()>;

impl Wrapper<{ bar() }> {
fn call() {}
}

fn main() {
Wrapper::<function>::call;
}
6 changes: 6 additions & 0 deletions tests/crashes/130411.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
//@ known-bug: #130411
trait Project {
const SELF: Self;
}

fn take1(_: Project<SELF = {}>) {}
17 changes: 17 additions & 0 deletions tests/crashes/130413.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
//@ known-bug: #130413

#![feature(transmutability)]
trait Aaa {
type Y;
}

trait Bbb {
type B: std::mem::TransmuteFrom<()>;
}

impl<T> Bbb for T
where
T: Aaa,
{
type B = T::Y;
}
13 changes: 13 additions & 0 deletions tests/crashes/130425.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
//@ known-bug: #130425
//@ compile-flags: -Zmir-opt-level=5 -Zpolymorphize=on

struct S<T>(T)
where
[T; (
|_: u8| {
static FOO: Sync = AtomicUsize::new(0);
unsafe { &*(&FOO as *const _ as *const usize) }
},
1,
)
.1]: Copy;
Loading