Skip to content
This repository has been archived by the owner on May 23, 2024. It is now read-only.

ices/93141.rs: fixed with no errors #1098

Merged
merged 1 commit into from
Jan 25, 2022
Merged

Conversation

github-actions[bot]
Copy link
Contributor

Issue: rust-lang/rust#93141

#![feature(generic_associated_types)]

pub trait Fooey: Sized {
    type Context<'c> where Self: 'c;
    /* // workaround
    type CallMe; */

    // fn fail2(callback: impl for<'c> Fn(&mut Self::Context<'c>)) -> Box<dyn for<'c> Fn(&mut Self::Context<'c>)> {
    //     Box::new(callback)
    // }
}

/* // workaround
pub struct Handle<E: Fooey>(Option<E::CallMe>); */
pub struct Handle<E: Fooey>(Option<Box<dyn for<'c> Fn(&mut E::Context<'c>)>>);

fn tuple<T>() -> (Option<T>,) { (Option::None,) }

pub struct FooImpl {}
impl Fooey for FooImpl {
    type Context<'c> = &'c ();
    /* // workaround
    type CallMe = Box<dyn for<'c> Fn(&mut Self::Context<'c>)>; */
}

impl FooImpl {
    pub fn fail1() -> Handle<Self> {
        let (tx,) = tuple();
        Handle(tx)
    }
}

fn main() {}
=== stdout ===
=== stderr ===
==============

=== stdout ===
=== stderr ===
==============
@Alexendoo Alexendoo merged commit 22dc8c9 into master Jan 25, 2022
@Alexendoo Alexendoo deleted the autofix/ices/93141.rs branch January 25, 2022 12:29
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants