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 is broken when default-featues = false #307

Closed
npmccallum opened this issue Sep 16, 2021 · 3 comments · Fixed by #309
Closed

cargo doc is broken when default-featues = false #307

npmccallum opened this issue Sep 16, 2021 · 3 comments · Fixed by #309

Comments

@npmccallum
Copy link
Member

This is particularly nasty because it also breaks cargo doc on all downstream uses of this crate with default-features = false.

@npmccallum
Copy link
Member Author

$ cargo doc --no-default-features
   Compiling x86_64 v0.14.4 (/home/npmccallum/enarx/x86_64)
    Checking volatile v0.4.4
    Checking bit_field v0.9.0
 Documenting bit_field v0.9.0
 Documenting volatile v0.4.4
 Documenting bitflags v1.3.2
    Checking bitflags v1.3.2
 Documenting x86_64 v0.14.4 (/home/npmccallum/enarx/x86_64)
error[E0433]: failed to resolve: could not find `instructions` in the crate root
 --> src/registers/model_specific.rs:5:5
  |
5 |     instructions::segmentation::{Segment64, FS, GS},
  |     ^^^^^^^^^^^^ could not find `instructions` in the crate root

error[E0433]: failed to resolve: could not find `instructions` in the crate root
 --> src/structures/gdt.rs:4:12
  |
4 | use crate::instructions::segmentation::{Segment, CS, SS};
  |            ^^^^^^^^^^^^ could not find `instructions` in the crate root

thread 'rustc' panicked at 'internal error: entered unreachable code', compiler/rustc_resolve/src/lib.rs:3341:67
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

error: internal compiler error: unexpected panic

error: Unrecognized option: 'crate-version'

For more information about this error, try `rustc --explain E0433`.
error: could not document `x86_64`

npmccallum added a commit to npmccallum/x86_64 that referenced this issue Sep 16, 2021
Fixes: rust-osdev#307

Signed-off-by: Nathaniel McCallum <nathaniel@profian.com>
@phil-opp
Copy link
Member

Thanks for reporting! I agree that this is unfortunate and should be fixed as soon as possible. I'm not sure if #308 is a good solution to this (see my comment there), but I'm currently working on a different solution.

phil-opp added a commit that referenced this issue Sep 17, 2021
The segment types themselves do not require the `instructions` feature, so it makes sense to move them to the top-level `registers` module. The `instructions::segmentation` module still re-exports all the types, so this change should not break any code.

Fixes #307
@phil-opp
Copy link
Member

I'm currently working on a different solution.

I opened a PR in #309.

phil-opp added a commit that referenced this issue Sep 17, 2021
The segment types themselves do not require the `instructions` feature, so it makes sense to move them to the top-level `registers` module. The `instructions::segmentation` module still re-exports all the types, so this change should not break any code.

Fixes #307
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants