Closed
Description
I found this originally while testing out #95445, but it's also present on master.
I tried this code: x test --stage 0 --doc compiler/rustc_lint_defs
I expected to see this happen: Tests pass, like they do for --stage 1
.
Instead, this happened:
Doc-tests rustc_lint_defs
running 106 tests
ii..........i..i.....i......i.ii.i.......i......iii.....................i.F......i..i.............i. 100/106
......
failures:
---- src/builtin.rs - builtin::UNFULFILLED_LINT_EXPECTATIONS (line 503) stdout ----
error: cannot find attribute `expect` in this scope
--> src/builtin.rs:506:3
|
5 | #[expect(unused_variables)]
| ^^^^^^
error: aborting due to previous error
Couldn't compile the test.
failures:
src/builtin.rs - builtin::UNFULFILLED_LINT_EXPECTATIONS (line 503)
test result: FAILED. 88 passed; 1 failed; 17 ignored; 0 measured; 0 filtered out; finished in 2.42s
It's unclear to me whether this is a bug in bootstrap / rustdoc / rustc_lint_defs, or whether doc-tests for the compiler just don't support --stage 0? If so I could add a warning the same way compiletest warns:
Lines 1261 to 1269 in 05d2221
cc @Mark-Simulacrum in case you have ideas.
Meta
HEAD is 11909e3.
@rustbot label +A-rustbuild
Metadata
Metadata
Assignees
Labels
Type
Projects
Milestone
Relationships
Development
No branches or pull requests
Activity
jyn514 commentedon Mar 31, 2022
x t --stage 0 compiler/rustc_llvm
is also broken for unrelated reasons, so I suspect no one has ever tried running unit tests with--stage 0
before.ehuss commentedon Mar 31, 2022
The issue is that tests may use new syntax and features without needing
#[cfg(bootstrap)]
. For example,expect
support was recently added in #87835 which isn't in beta.I personally would just add a warning or error that tests may not work with stage0.
jyn514 commentedon May 6, 2022
This is fixed since the beta bump; closing since it sounds like doctests aren't supported on stage 0.