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

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

Closed
5225225 opened this issue Aug 2, 2022 · 1 comment · Fixed by #109667
Closed

Comments

@5225225
Copy link
Contributor

5225225 commented Aug 2, 2022

[...]
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.

@ehuss
Copy link
Contributor

ehuss commented Aug 2, 2022

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants