New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cargo doc fails to compile existential associated types #58011

Open
alecmocatta opened this Issue Jan 30, 2019 · 0 comments

Comments

Projects
None yet
2 participants
@alecmocatta
Copy link
Contributor

alecmocatta commented Jan 30, 2019

While building, testing and running the below code works fine, cargo doc fails with:

error[E0277]: the trait bound `(): D` is not satisfied
  --> test_existential_doc_crash.rs:13:5
   |
13 |     existential type B: D;
   |     ^^^^^^^^^^^^^^^^^^^^^^ the trait `D` is not implemented for `()`
   |
   = note: the return type of a function must have a statically known size
#![feature(existential_type)]

pub trait A {
    type B: D;
    fn c() -> Self::B;
}

pub trait D {}
impl D for u8 {}

pub struct E;
impl A for E {
    existential type B: D;
    fn c() -> Self::B {
        0u8
    }
}

brunocodutra added a commit to brunocodutra/reducer that referenced this issue Feb 4, 2019

brunocodutra added a commit to brunocodutra/reducer that referenced this issue Feb 5, 2019

brunocodutra added a commit to brunocodutra/reducer that referenced this issue Feb 5, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment