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

ices/109020.rs: fixed with no errors #1616

Merged
merged 1 commit into from
Jun 30, 2023
Merged

Conversation

github-actions[bot]
Copy link
Contributor

Issue: rust-lang/rust#109020

#![feature(type_alias_impl_trait)]

use core::marker::PhantomData;

type WithEmplacableForFn<'a> = impl EmplacableFn + 'a;

fn with_emplacable_for<'a, F, R>(mut f: F) -> R
where
    F: for<'b> FnMut(Emplacable<WithEmplacableForFn<'b>>) -> R,
{
    fn with_emplacable_for_inner<'a, R>(
        _: &'a (),
        _: &mut dyn FnMut(Emplacable<WithEmplacableForFn<'a>>) -> R,
    ) -> R {
        fn _constrain(_: &mut ()) -> WithEmplacableForFn<'_> {
            ()
        }
        loop {}
    }

    with_emplacable_for_inner(&(), &mut f)
}

trait EmplacableFn {}

impl EmplacableFn for () {}

struct Emplacable<F>
where
    F: EmplacableFn,
{
    phantom: PhantomData<F>,
}

fn main() {
    with_emplacable_for(|_| {});
}
=== stdout ===
=== stderr ===
==============

=== stdout ===
=== stderr ===
==============
@Alexendoo Alexendoo merged commit d2043d9 into master Jun 30, 2023
@Alexendoo Alexendoo deleted the autofix/ices/109020.rs branch June 30, 2023 11:19
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