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

add a few more crashtests #129869

Merged
merged 1 commit into from
Sep 8, 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
10 changes: 10 additions & 0 deletions tests/crashes/123629.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
//@ known-bug: #123629
#![feature(generic_assert)]

fn foo()
where
for<const N: usize = { assert!(u) }> ():,
{
}

fn main() {}
18 changes: 18 additions & 0 deletions tests/crashes/127033.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
//@ known-bug: #127033
//@ compile-flags: --edition=2021

pub trait RaftLogStorage {
fn save_vote(vote: ()) -> impl std::future::Future + Send;
}

struct X;
impl RaftLogStorage for X {
fn save_vote(vote: ()) -> impl std::future::Future {
loop {}
async {
vote
}
}
}

fn main() {}
52 changes: 52 additions & 0 deletions tests/crashes/129372.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
//@ known-bug: #129372
//@ compile-flags: -Cdebuginfo=2 -Copt-level=0

pub struct Wrapper<T>(T);
struct Struct;

pub trait TraitA {
type AssocA<'t>;
}
pub trait TraitB {
type AssocB;
}

pub fn helper(v: impl MethodTrait) {
let _local_that_causes_ice = v.method();
}

pub fn main() {
helper(Wrapper(Struct));
}

pub trait MethodTrait {
type Assoc<'a>;

fn method(self) -> impl for<'a> FnMut(&'a ()) -> Self::Assoc<'a>;
}

impl<T: TraitB> MethodTrait for T
where
<T as TraitB>::AssocB: TraitA,
{
type Assoc<'a> = <T::AssocB as TraitA>::AssocA<'a>;

fn method(self) -> impl for<'a> FnMut(&'a ()) -> Self::Assoc<'a> {
move |_| loop {}
}
}

impl<T, B> TraitB for Wrapper<B>
where
B: TraitB<AssocB = T>,
{
type AssocB = T;
}

impl TraitB for Struct {
type AssocB = Struct;
}

impl TraitA for Struct {
type AssocA<'t> = Self;
}
Loading