You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Marking a doctest code block as edition2018 causes it not to run #65980
I can cargo build and cargo test this library. The doctest is obviously never run because 1 + 1 == 999 is false. The output from cargo test confirms this, showing that zero test were run.
The doctest book lead me to believe the doctest should still work, even if marked as edition2018.
Cargo.toml is:
[package]
name = "foo"version = "0.1.0"authors = ["..."]
edition = "2018"# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[dependencies]
Activity
ehuss commentedon Oct 31, 2019
That's really strange! It works on nightly...any nightly!
I think it is due to this code:
rust/src/librustdoc/html/markdown.rs
Lines 683 to 686 in c553e8e
Was this maybe forgotten to be stabilized when editions were stabilized?
DevJac commentedon Nov 8, 2019
This still happens with Rust
1.39.0. I created a minimal project that demonstrates this bug at https://github.com/DevJac/rust_edition2018_doctest_bug_demo .ehuss commentedon Nov 9, 2019
I posted PR #66238 to fix this.
Rollup merge of rust-lang#66238 - ehuss:stabilize-rustdoc-edition, r=…
Auto merge of #66238 - ehuss:stabilize-rustdoc-edition, r=GuillaumeGomez