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

ices/63355.rs: fixed with errors #491

Merged
merged 1 commit into from
Oct 7, 2020
Merged

Conversation

github-actions[bot]
Copy link
Contributor

@github-actions github-actions bot commented Oct 7, 2020

Issue: rust-lang/rust#63355

#![feature(type_alias_impl_trait)]

pub trait Foo {}

pub trait Bar {
    type Foo: Foo;

    fn foo() -> Self::Foo;
}

pub trait Baz {
    type Foo: Foo;
    type Bar: Bar<Foo = Self::Foo>;

    fn foo() -> Self::Foo;
    fn bar() -> Self::Bar;
}

impl Foo for () {}

impl Bar for () {
    type Foo = FooImpl;

    fn foo() -> Self::Foo {
        ()
    }
}

pub type FooImpl = impl Foo;
pub type BarImpl = impl Bar<Foo = FooImpl>;

impl Baz for () {
    type Foo = FooImpl;
    type Bar = BarImpl;

    fn foo() -> Self::Foo {
        ()
    }

    fn bar() -> Self::Bar {
        ()
    }
}

fn main() {}
=== stdout ===
=== stderr ===
error[E0271]: type mismatch resolving `<() as Bar>::Foo == ()`
  --> /home/runner/work/glacier/glacier/ices/63355.rs:30:20
   |
29 | pub type FooImpl = impl Foo;
   |                    -------- the expected opaque type
30 | pub type BarImpl = impl Bar<Foo = FooImpl>;
   |                    ^^^^^^^^^^^^^^^^^^^^^^^ expected opaque type, found `()`
   |
   = note: expected opaque type `impl Foo`
                found unit type `()`

error: aborting due to previous error

For more information about this error, try `rustc --explain E0271`.
==============

=== stdout ===
=== stderr ===
error[E0271]: type mismatch resolving `<() as Bar>::Foo == ()`
  --> /home/runner/work/glacier/glacier/ices/63355.rs:30:20
   |
29 | pub type FooImpl = impl Foo;
   |                    -------- the expected opaque type
30 | pub type BarImpl = impl Bar<Foo = FooImpl>;
   |                    ^^^^^^^^^^^^^^^^^^^^^^^ expected opaque type, found `()`
   |
   = note: expected opaque type `impl Foo`
                found unit type `()`

error: aborting due to previous error

For more information about this error, try `rustc --explain E0271`.
==============
@JohnTitor JohnTitor merged commit ad137e0 into master Oct 7, 2020
@JohnTitor JohnTitor deleted the autofix/ices/63355.rs branch October 7, 2020 12:57
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