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

ices/89864.rs: fixed with no errors #1104

Closed
wants to merge 1 commit into from

Conversation

github-actions[bot]
Copy link
Contributor

@github-actions github-actions bot commented Feb 1, 2022

Issue: rust-lang/rust#89864

#![crate_type = "lib"]

use core::{fmt, marker::PhantomData};

pub trait WrapperTrait {
    type Assoc;
}

pub trait Trait {
    type Assoc;
}

pub struct Ice<T>(<<Dynamic<T> as WrapperTrait>::Assoc as Trait>::Assoc);

impl<T> fmt::Debug for Ice<T>
where
    <<Dynamic<T> as WrapperTrait>::Assoc as Trait>::Assoc: fmt::Debug,
{
    fn fmt(&self, _: &mut fmt::Formatter) -> fmt::Result {
        format_args!("{:?}", self.0);
        todo!()
    }
}

pub struct TraitImplementor;

impl Trait for TraitImplementor {
    type Assoc = ConcreteAssoc;
}

pub struct ConcreteAssoc;

impl<T> WrapperTrait for Dynamic<T> {
    type Assoc = TraitImplementor;
}

pub struct Dynamic<T>(PhantomData<T>);
=== stdout ===
=== stderr ===
==============

=== stdout ===
=== stderr ===
==============
@Alexendoo
Copy link
Member

9addd9e

@Alexendoo Alexendoo closed this Feb 1, 2022
@Alexendoo Alexendoo deleted the autofix/ices/89864.rs branch February 1, 2022 13:52
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