It's not completely clear whether this is a Reference bug, or a bug in mdBook.
The provided build setup instructions in the dev-guide are incomplete. Context: I currently have my rustup default toolchain set to stable. Installing the nightly toolchain and setting a rustup override in the reference directory (as instructed) seems to be sufficient for building, but running tests doesn't always work. Setting rustup default nightly seems to be necessary to run the tests directly from mdbook test.
Running cargo xtask test-all succeeds for some reason, even without rustup default nightly. Directly running mdbook test from the reference directory succeeds if rustup default nightly has been set, or if RUSTUP_TOOLCHAIN=nightly is set in the environment.
As far as I can tell from its source code, mdbook test uses a temporary directory (based on the OS default), which in general won't be subject to the override set in the reference directory. I don't know what additional setup is being propagated either from cargo run or xtask that is causing cargo xtask test-all to succeed.
macOS 15.7.5 (24G624) in case that matters.
Sample failure output
test expressions/operator-expr.md - Operator_expressions::Type_cast_expressions::Semantics::Pointer_to_pointer_cast (line 2074) - compile fail ... ok
failures:
---- expressions/operator-expr.md - Operator_expressions::The_try_propagation_expression (line 785) stdout ----
error[E0554]: `#![feature]` may not be used on the stable release channel
--> expressions/operator-expr.md:785:1
|
785 | #![ feature(try_trait_v2) ]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^
error: aborting due to 1 previous error
For more information about this error, try `rustc --explain E0554`.
Couldn't compile the test.
It's not completely clear whether this is a Reference bug, or a bug in mdBook.
The provided build setup instructions in the dev-guide are incomplete. Context: I currently have my rustup default toolchain set to stable. Installing the nightly toolchain and setting a rustup override in the reference directory (as instructed) seems to be sufficient for building, but running tests doesn't always work. Setting
rustup default nightlyseems to be necessary to run the tests directly frommdbook test.Running
cargo xtask test-allsucceeds for some reason, even withoutrustup default nightly. Directly runningmdbook testfrom the reference directory succeeds ifrustup default nightlyhas been set, or ifRUSTUP_TOOLCHAIN=nightlyis set in the environment.As far as I can tell from its source code,
mdbook testuses a temporary directory (based on the OS default), which in general won't be subject to the override set in the reference directory. I don't know what additional setup is being propagated either fromcargo runorxtaskthat is causingcargo xtask test-allto succeed.macOS 15.7.5 (24G624) in case that matters.
Sample failure output