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

ices/70746.rs: fixed with no errors #514

Merged
merged 1 commit into from
Oct 23, 2020
Merged

Conversation

github-actions[bot]
Copy link
Contributor

Issue: rust-lang/rust#70746

pub trait Trait1 {
    type C;
}

struct T1;
impl Trait1 for T1 {
    type C = usize;
}
pub trait Callback<T: Trait1>: FnMut(<T as Trait1>::C) {}
impl<T: Trait1, F: FnMut(<T as Trait1>::C)> Callback<T> for F {}

pub struct State<T: Trait1> {
    callback: Option<Box<dyn Callback<T>>>,
}
impl<T: Trait1> State<T> {
    fn new() -> Self {
        Self { callback: None }
    }
    fn test_cb(&mut self, d: <T as Trait1>::C) {
        (self.callback.as_mut().unwrap())(d)
    }
}

fn main() {
    let mut s = State::<T1>::new();
    s.test_cb(1);
}
=== stdout ===
=== stderr ===
==============

=== stdout ===
=== stderr ===
==============
@Alexendoo Alexendoo merged commit 08969be into master Oct 23, 2020
@Alexendoo Alexendoo deleted the autofix/ices/70746.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