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

ices/90691.rs: fixed with no errors #1574

Merged
merged 1 commit into from
May 3, 2023
Merged

Conversation

github-actions[bot]
Copy link
Contributor

@github-actions github-actions bot commented May 3, 2023

Issue: rust-lang/rust#90691

#![feature(associated_type_bounds)]

trait TError: std::fmt::Debug {}
impl TError for () {}

trait SuperTrait {
    type Error;
}

trait Trait: SuperTrait<Error: TError> {}

impl<T> Trait for T
where
    T: SuperTrait,
    <T as SuperTrait>::Error: TError,
{
}

struct SomeTrait<S>(S);
struct BoxedTrait(Box<dyn Trait<Error = ()>>);

impl<S: 'static> From<SomeTrait<S>> for BoxedTrait {
    fn from(other: SomeTrait<S>) -> Self {
        Self(Box::new(other))
    }
}

impl<S> SuperTrait for SomeTrait<S> {
    type Error = ();
}

impl From<()> for BoxedTrait {
    fn from(c: ()) -> Self {
        Self::from(SomeTrait(c))
    }
}

fn main() {
    let _: BoxedTrait = ().into();
}
=== stdout ===
=== stderr ===
==============

=== stdout ===
=== stderr ===
==============
@JohnTitor JohnTitor merged commit 18df430 into master May 3, 2023
@JohnTitor JohnTitor deleted the autofix/ices/90691.rs branch May 3, 2023 14:37
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