-
Notifications
You must be signed in to change notification settings - Fork 13k
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 with panic in rustc.
#49883
Comments
Thanks for reporting this! Can you post the full output? |
@pietroalbini full output in terminal? Sure. I'll edit in the post |
Good news: this is fixed on nightly. Bad news: it's busted on beta and stable. From what i can tell of the stack trace, it has something to do with cleaning an item with an associated const? The only associated consts in this crate aren't even exported by the demo - they're secondhand from the types that are. The only suspect associated consts i can tell are ones like these: impl<T> AsVertexFormat for T
where
T: Attribute,
{
// i'd say the implied 'static on that slice is suspect, but it's actually explicit in the const declaration >_>
const VERTEX_FORMAT: VertexFormat<'static> = VertexFormat {
attributes: Cow::Borrowed(&[
Element {
format: T::SELF,
offset: 0,
},
]),
stride: T::SIZE,
};
} impl AsFormat for Position {
// AsFormat and its impl on `[f32; 3]` are themselves pulled from a separate crate, `gfx-hal`
const SELF: Format = <[f32; 3] as AsFormat>::SELF;
} I'm not totally sure what the real problem is that it's having. I need to dig farther. |
Update: Rustdoc is pulling in the offending trait implementations because rustdoc pulls in every trait implementation when it imports an item from another crate. The code i poked at within rustdoc itself seemed to not change very much between beta and nightly, so i suspect the failure is in the const rendering code, likely in |
Bisected this, fixed in PR #49386. For the record, documenting on the latest nightly outputs:
|
@pietroalbini Thanks! Those warnings are intra-link resolution problems. I opened #50082 to ensure we don't get any in std. |
Hmm, if that PR fixed it, then this issue would be a duplicate of #47391, which that PR fixed. Should we backport that PR so we can at least get it in beta? |
Yeah, this is a duplicate, but I don't know the policy about backporting non-regression bugfixes. |
That PR has been backported to beta. Closing this. |
I try to document crate (with
cargo doc
) andrustc
panics.Although
cargo build
works wellIt seems that those lines causing the panic:
In
lib.rs
:In
Cargo.toml
:Meta
rustc --version --verbose
:RUST_BACKTRACE=full cargo doc
:The text was updated successfully, but these errors were encountered: