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

ices/73229.rs: fixed with no errors #515

Merged
merged 1 commit into from
Oct 23, 2020
Merged

Conversation

github-actions[bot]
Copy link
Contributor

Issue: rust-lang/rust#73229

fn any<T>() -> T { loop {} }

trait Foo { type V; }

trait Callback<T: Foo>: Fn(&T, &T::V) {}
impl<T: Foo, F: Fn(&T, &T::V)> Callback<T> for F {}

struct Bar<T: Foo> {
    callback: Box<dyn Callback<T>>,
}

impl<T: Foo> Bar<T> {
    fn event(&self) {
        (self.callback)(any(), any());
    }
}

struct A;
struct B;
impl Foo for A { type V = B; }

fn main() {
    let foo = Bar::<A> {
        callback: Box::new(|_: &A, _: &B| ()),
    };
    foo.event();
}
=== stdout ===
=== stderr ===
==============

=== stdout ===
=== stderr ===
==============
@Alexendoo Alexendoo merged commit 215f176 into master Oct 23, 2020
@Alexendoo Alexendoo deleted the autofix/ices/73229.rs branch October 23, 2020 16:18
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