Skip to content

./x.py doc on a clean repo on master passes, but with warnings about feature gates #100060

@ghost

Description

[...]
Documenting error index (x86_64-unknown-linux-gnu)
Building stage0 tool error_index_generator (x86_64-unknown-linux-gnu)
    Finished release [optimized] target(s) in 0.18s
Generating lint docs (x86_64-unknown-linux-gnu)
Building stage0 tool lint-docs (x86_64-unknown-linux-gnu)
    Finished release [optimized] target(s) in 0.15s
warning: the code example in lint `unfulfilled_lint_expectations` in /home/jess/src/rust/compiler/rustc_lint_defs/src/builtin.rs failed to generate the expected output: did not find lint `unfulfilled_lint_expectations` in output of example, got:

error[E0554]: `#![feature]` may not be used on the beta release channel
 --> lint_example.rs:1:1
  |
1 | #![feature(lint_reasons)]
  | ^^^^^^^^^^^^^^^^^^^^^^^^^


error: aborting due to previous error


For more information about this error, try `rustc --explain E0554`.

warning: the code example in lint `unused_allocation` in /home/jess/src/rust/compiler/rustc_lint/src/unused.rs failed to generate the expected output: did not find lint `unused_allocation` in output of example, got:

error[E0554]: `#![feature]` may not be used on the beta release channel
 --> lint_example.rs:1:1
  |
1 | #![feature(box_syntax)]
  | ^^^^^^^^^^^^^^^^^^^^^^^


error: aborting due to previous error


For more information about this error, try `rustc --explain E0554`.

Rustbook (x86_64-unknown-linux-gnu) - rustc
Documenting stage0 clippy (x86_64-unknown-linux-gnu)
    Finished release [optimized] target(s) in 0.21s
Documenting stage0 miri (x86_64-unknown-linux-gnu)
    Finished release [optimized] target(s) in 0.17s
Build completed successfully in 0:01:10
./x.py doc  63.71s user 11.62s system 105% cpu 1:11.48 total

This should probably fail docs, but also it shouldn't happen in the first place. Not entirely sure why the other lines in the file don't trigger this, but I'm just making a note of this.

Activity

ehuss

ehuss commented on Aug 2, 2022

@ehuss
Contributor

Not failing with x.py doc is intentional. We didn't want generating the documentation to depend on tests passing, as that can make it difficult to work with. There is a separate x.py test src/tools/lint-docs which will fail if they are not passing. It could add a note explaining why it is only a warning, though.

As for why it is failing at all, it seems to have been broken by #97277 (cc @jyn514). This happens when using stage0 for building documentation (which is not what is normally done for distribution). That check is looking at builder.unstable_features, but what it really wants is to see if self.compiler is one that supports nightly (because stage 0 rustc on a dev/nightly channel reports that unstable_features is allowed, but the stage0 rustc doesn't support unstable features). I'm not sure if there is anything that would actually give the correct result here. It probably wouldn't be too harmful to just unconditionally set it.

added a commit that references this issue on Mar 28, 2023
1af75b1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      Participants

      @ehuss

      Issue actions

        `./x.py doc` on a clean repo on master passes, but with warnings about feature gates · Issue #100060 · rust-lang/rust