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

ices/56229.rs: fixed with no errors #512

Merged
merged 1 commit into from
Oct 23, 2020
Merged

Conversation

github-actions[bot]
Copy link
Contributor

Issue: rust-lang/rust#56229

trait Mirror {
    type Other;
}

#[derive(Debug)]
struct Even(usize);
struct Odd;

impl Mirror for Even {
    type Other = Odd;
}

impl Mirror for Odd {
    type Other = Even;
}

trait Dyn<T: Mirror>: AsRef<<T as Mirror>::Other> { }

impl Dyn<Odd> for Even {}

impl AsRef<Even> for Even {
    fn as_ref(&self) -> &Even {
        self
    }
}

fn code<T: Mirror>(d: &dyn Dyn<T>) -> &T::Other {
    d.as_ref()
}

fn main() {
    println!("{:?}", code(&Even(22)));
}
=== stdout ===
=== stderr ===
==============

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