Closed
Description
#![feature(existential_type)]
pub trait SomeTrait {
fn some_fn(&self) {}
type SomeType;
}
struct SomeStruct;
impl SomeTrait for SomeStruct {
type SomeType = String;
}
pub existential type Asdf: SomeTrait;
pub fn asdf() -> Asdf { SomeStruct }
This sample compiles just fine, but when you run it in rustdoc...
$ rustdoc +nightly c.rs
error[E0277]: the trait bound `(): SomeTrait` is not satisfied
--> c.rs:15:1
|
15 | pub existential type Asdf: SomeTrait;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `SomeTrait` is not implemented for `()`
|
= note: the return type of a function must have a statically known size
error: Compilation failed, aborting rustdoc
$ rustdoc +nightly --version
rustdoc 1.34.0-nightly (f66e4697a 2019-02-20)
My personal guess is that the fact that rustdoc runs everybody_loops
on the function that defines this type means that it no longer returns the actual type - instead it returns !
, though the compiler picks up ()
for the error message.
Metadata
Metadata
Assignees
Labels
Area: `impl Trait`. Universally / existentially quantified anonymous types with static dispatch.`#[feature(type_alias_impl_trait)]`Relevant to the compiler team, which will review and decide on the PR/issue.Relevant to the rustdoc team, which will review and decide on the PR/issue.This issue requires a nightly compiler in some way.
Type
Projects
Status
Done