Skip to content
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": error: could not document rustix v0.36.11 #109631

Closed
fekerr opened this issue Mar 26, 2023 · 12 comments · Fixed by #109500
Closed

"cargo doc": error: could not document rustix v0.36.11 #109631

fekerr opened this issue Mar 26, 2023 · 12 comments · Fixed by #109500
Assignees
Labels
A-intra-doc-links Area: Intra-doc links, the ability to link to items in docs by name C-bug Category: This is a bug. I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue.

Comments

@fekerr
Copy link

fekerr commented Mar 26, 2023

Experimenting with Rocket and learning Rust. Updating this issue is a work in progress.

fekerr@LAPTOP:~/src/boing001$ cat Cargo.toml

[package]
name = "boing001"
version = "0.1.0"
edition = "2021"

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[dependencies]
# rocket = "0.4.11"
rocket = "0.5.0-rc.3"

Code

<code>
fekerr@LAPTOP:~/src/boing001$ cat src/main.rs
// 20230325 fekerr
// main.rs
//
// traitobj crate - issues in future?

// Rocket requires rustc nightly, and these two lines.
#![feature(proc_macro_hygiene, decl_macro)]
#[macro_use] extern crate rocket;

fn main() {
    println!("Hello, world!");
}

Meta

rustc --version --verbose:

 rustc --version --verbose
rustc 1.70.0-nightly (1459b3128 2023-03-23)
binary: rustc
commit-hash: 1459b3128e288a85fcc4dd1fee7ada2cdcf28794
commit-date: 2023-03-23
host: x86_64-unknown-linux-gnu
release: 1.70.0-nightly
LLVM version: 15.0.7

Error output

<output>

cargo doc 2> cargo_doc.txt
[cargo_doc.txt](https://github.com/rust-lang/rust/files/11071785/cargo_doc.txt)


Backtrace


<backtrace>

fekerr@LAPTOP:~/src/boing001$ RUST_BACKTRACE=1 cargo build 2> cargo_build_rbt1.txt
fekerr@LAPTOP:~/src/boing001$ RUST_BACKTRACE=1 cargo build 2> cargo_doc_rbt1.txt
[cargo_build_rbt1.txt](https://github.com/rust-lang/rust/files/11071820/cargo_build_rbt1.txt)
[cargo_doc_rbt1.txt](https://github.com/rust-lang/rust/files/11071821/cargo_doc_rbt1.txt)

@fekerr fekerr added C-bug Category: This is a bug. I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Mar 26, 2023
@clubby789
Copy link
Contributor

clubby789 commented Mar 26, 2023

Looks like a duplicate of #109614/#109424

@rustbot label +A-intra-doc-links +T-rustdoc

@rustbot rustbot added A-intra-doc-links Area: Intra-doc links, the ability to link to items in docs by name T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue. labels Mar 26, 2023
@GuillaumeGomez
Copy link
Member

#109330 should fix this bug. Just waiting for a final review.

@petrochenkov
Copy link
Contributor

Not fixed by #109330, but fixed by #109500.

@fekerr
Copy link
Author

fekerr commented Mar 31, 2023

rustup update
cargo update
cargo doc

"cargo doc" completes now

That's literally all I just tried (not the literal commands) - what is the process to close this issue?

@GuillaumeGomez
Copy link
Member

It'll be closed once #109500 is merged. But I'm surprised it got fixed. When I tested it with my changes, it still failed.

@clubby789
Copy link
Contributor

cargo update may have caused an update to a dependency so you no longer had the buggy rustix

@fekerr
Copy link
Author

fekerr commented Apr 1, 2023

diff Cargo.toml ../boing002/Cargo.toml
9d8
< # rocket = "0.4.11"
10a10,12

serde = { version = "1.0", features = ["derive"] }
serde_json = "1.0"
fnv = "1.0"

@fekerr
Copy link
Author

fekerr commented Apr 1, 2023

cargo doc fails in this tree:

:~/src/boing001$ cat Cargo.toml
[package]
name = "boing001"
version = "0.1.0"
edition = "2021"

See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[dependencies]

rocket = "0.4.11"

rocket = "0.5.0-rc.3"

@fekerr
Copy link
Author

fekerr commented Apr 1, 2023

Does not fail in this tree:

~/src/boing002$ cat Cargo.toml
[package]
name = "boing001"
version = "0.1.0"
edition = "2021"

See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[dependencies]
rocket = "0.5.0-rc.3"
serde = { version = "1.0", features = ["derive"] }
serde_json = "1.0"
fnv = "1.0"

@fekerr
Copy link
Author

fekerr commented Apr 1, 2023

main.rs in boing001 is just this:

// 20230325 fekerr
// main.rs
//
// traitobj crate - issues in future?

// Rocket requires rustc nightly, and these two lines.
#![feature(proc_macro_hygiene, decl_macro)]
#[macro_use] extern crate rocket;

fn main() {
println!("Hello, world!");
}

@fekerr
Copy link
Author

fekerr commented Apr 1, 2023

$ grep -i rustix fekerr@LAPTOP\ ~srcboing003src.txt
Updating rustix v0.37.5 -> v0.37.6
Downloaded rustix v0.37.6
Compiling rustix v0.37.6
Documenting rustix v0.37.6
Compiling rustix v0.37.6
Compiling rustix v0.36.11
Documenting rustix v0.36.11
error: could not document rustix
process didn't exit successfully: rustdoc --edition=2018 --crate-type lib --crate-name rustix /home/fekerr/.cargo/registry/src/index.crates.io-6f17d22bba15001f/rustix-0.36.11/src/lib.rs --cap-lints allow -o /home/fekerr/src/boing001/target/doc --cfg 'feature="default"' --cfg 'feature="fs"' --cfg 'feature="io-lifetimes"' --cfg 'feature="libc"' --cfg 'feature="std"' --cfg 'feature="termios"' --cfg 'feature="use-libc-auxv"' --error-format=json --json=diagnostic-rendered-ansi,artifacts,future-incompat --diagnostic-width=108 -C metadata=ff3e1caa83851d6d -L dependency=/home/fekerr/src/boing001/target/debug/deps --extern bitflags=/home/fekerr/src/boing001/target/debug/deps/libbitflags-f75283d3dcd3daad.rmeta --extern io_lifetimes=/home/fekerr/src/boing001/target/debug/deps/libio_lifetimes-0e896a4daa128e32.rmeta --extern libc=/home/fekerr/src/boing001/target/debug/deps/liblibc-8aab922602f2fc15.rmeta --extern linux_raw_sys=/home/fekerr/src/boing001/target/debug/deps/liblinux_raw_sys-a31463b73c270e13.rmeta --crate-version 0.36.11 --cfg rustc_attrs --cfg linux_raw --cfg core_intrinsics --cfg asm (exit status: 101)
Compiling rustix v0.37.6
Documenting rustix v0.37.6
Compiling rustix v0.37.6
Documenting rustix v0.37.6
Compiling rustix v0.37.6
Documenting rustix v0.37.6

@fekerr
Copy link
Author

fekerr commented Apr 8, 2023

I doubt I'm really contributing anything here, but a cargo new with just rustix dependency. (I need to look up how to find the available versions of rustix if it's worth narrowing down any further.)

"cargo doc" fails with rustix 0.36.11, doesn't fail with 0.37.9.

[package]
name = "rustix_doc_test"
version = "0.1.0"
edition = "2021"

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[dependencies]
# 37.9 works with "cargo doc"
# rustix = "0.37.9"

rustix = "0.36.11"

@fekerr fekerr changed the title "cargo doc": error: could not document rustix "cargo doc": error: could not document rustix v0.36.11 Apr 9, 2023
@bors bors closed this as completed in 7201301 Apr 9, 2023
thomcc pushed a commit to tcdi/postgrestd that referenced this issue Jun 1, 2023
resolve: Preserve reexport chains in `ModChild`ren

This may be potentially useful for
- avoiding uses of `hir::ItemKind::Use` (which usually lead to correctness issues)
- preserving documentation comments on all reexports, including those from other crates
- preserving and checking stability/deprecation info on reexports
- all kinds of diagnostics

The second commit then migrates some hacky logic from rustdoc to `module_reexports` to make it simpler and more correct.
Ideally rustdoc should use `module_reexports` immediately at the top level, so `hir::ItemKind::Use`s are never used.
The second commit also fixes issues with rust-lang/rust#109330 and therefore
Fixes rust-lang/rust#109631
Fixes rust-lang/rust#109614
Fixes rust-lang/rust#109424
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-intra-doc-links Area: Intra-doc links, the ability to link to items in docs by name C-bug Category: This is a bug. I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants