Skip to content

Rustdoc: Unable to fulfill trait #53102

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

Closed
ghost opened this issue Aug 6, 2018 · 3 comments
Closed

Rustdoc: Unable to fulfill trait #53102

ghost opened this issue Aug 6, 2018 · 3 comments
Labels
C-bug Category: This is a bug. I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue.

Comments

@ghost
Copy link

ghost commented Aug 6, 2018

I tried this code:

cargo doc

I expected to see this happen: documentation

Instead, this happened:
Documenting capnp v0.8.17
Checking iovec v0.1.2
Checking net2 v0.2.33
Checking rand v0.4.2
Checking num_cpus v1.8.0
Checking memchr v2.0.1
Checking time v0.1.40
thread '' panicked at 'Unable to fulfill trait DefId(2/0:865 ~ core[a6fc]::marker[0]::Send[0]) for 'list_list::Owned': [FulfillmentError(Obligation(predicate=Binder(ProjectionPredicate(ProjectionTy { substs: [T, ReStatic], item_def_id: DefId(0/0:1150 ~ capnp[8787]::traits[0]::Owned[0]::Reader[0]) }, )),depth=2),Ambiguity), FulfillmentError(Obligation(predicate=Binder(TraitPredicate(< as std::marker::Send>)),depth=2),Ambiguity)]', librustc/traits/auto_trait.rs:218:17
note: Run with RUST_BACKTRACE=1 for a backtrace.
Compiling openssl-sys v0.9.33

error: internal compiler error: unexpected panic

note: the compiler unexpectedly panicked. this is a bug.

note: we would appreciate a bug report: https://github.com/rust-lang/rust/blob/master/CONTRIBUTING.md#bug-reports

note: rustc 1.28.0 (9634041 2018-07-30) running on x86_64-unknown-linux-gnu

error: Could not document capnp.

Caused by:
process didn't exit successfully: rustdoc --crate-name capnp /home/oussama/.cargo/registry/src/github.com-1ecc6299db9ec823/capnp-0.8.17/src/lib.rs -o /home/oussama/Desktop/rust/playground/target/doc -L dependency=/home/oussama/Desktop/rust/playground/target/debug/deps --extern byteorder=/home/oussama/Desktop/rust/playground/target/debug/deps/libbyteorder-af85c17f60f27595.rmeta (exit code: 101)
warning: build failed, waiting for other jobs to finish...
error: build failed

Meta

rustc --version --verbose:

rustc 1.28.0 (9634041 2018-07-30)
binary: rustc
commit-hash: 9634041
commit-date: 2018-07-30
host: x86_64-unknown-linux-gnu
release: 1.28.0
LLVM version: 6.0

@dwrensha
Copy link
Contributor

dwrensha commented Aug 7, 2018

cargo doc -p capnp works without any trouble on rustc 1.25.0, and hits the above error on rustc 1.26.0, so the problem must have been introduce in that release cycle.

@dwrensha
Copy link
Contributor

Smaller piece of code that hits the same problem:

// lib.rs

pub trait FromPointerReader<'a> : Sized {}

pub struct PointerReader<'a>  {
    _arena: &'a [u8],
}

pub trait OwnedTrait<'a> {
    type Reader: FromPointerReader<'a>;
}

pub struct Owned<T> where T: for<'a> OwnedTrait<'a> {
    marker: ::std::marker::PhantomData<<T as OwnedTrait<'static>>::Reader>,
}
$ rustdoc --version
rustdoc 1.28.0 (9634041f0 2018-07-30)
$ rustdoc lib.rs
thread '<unnamed>' panicked at 'Unable to fulfill trait DefId(2/0:865 ~ core[537d]::marker[0]::Send[0]) for 'Owned<T>': [FulfillmentError(Obligation(predicate=Binder(ProjectionPredicate(ProjectionTy { substs: [T, ReStatic], item_def_id: DefId(0/0:6 ~ lib[8787]::OwnedTrait[0]::Reader[0]) }, _)),depth=2),Ambiguity), FulfillmentError(Obligation(predicate=Binder(TraitPredicate(<_ as std::marker::Send>)),depth=2),Ambiguity)]', librustc/traits/auto_trait.rs:218:17
note: Run with `RUST_BACKTRACE=1` for a backtrace.

error: internal compiler error: unexpected panic

note: the compiler unexpectedly panicked. this is a bug.

note: we would appreciate a bug report: https://github.com/rust-lang/rust/blob/master/CONTRIBUTING.md#bug-reports

note: rustc 1.28.0 (9634041f0 2018-07-30) running on x86_64-apple-darwin

@dtolnay dtolnay changed the title note: the compiler unexpectedly panicked. this is a bug. Rustdoc: Unable to fulfill trait Aug 13, 2018
@dtolnay dtolnay added I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue. C-bug Category: This is a bug. labels Aug 13, 2018
@dtolnay
Copy link
Member

dtolnay commented Aug 13, 2018

Fixed in #52990.

@dtolnay dtolnay closed this as completed Aug 13, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-bug Category: This is a bug. I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue.
Projects
None yet
Development

No branches or pull requests

2 participants