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
compiling it with rustc --edition 2018 temp.rs works. Attempting to run the doc-test via rustdoc -Z unstable-options --edition 2018 --test temp.rs gives:
running 1 test
test temp.rs - main (line 3) ... FAILED
failures:
---- temp.rs - main (line 3) stdout ----
error[E0422]: cannot find struct, variant or union type `async` in this scope
--> temp.rs:6:13
|
4 | let _ = async { };
| ^^^^^ not found in this scope
thread 'temp.rs - main (line 3)' panicked at 'couldn't compile the test', librustdoc/test.rs:327:17
note: Run with `RUST_BACKTRACE=1` for a backtrace.
failures:
temp.rs - main (line 3)
test result: FAILED. 0 passed; 1 failed; 0 ignored; 0 measured; 0 filtered out
which is the same error that rustc --edition 2015 temp.rs gives.
So your problem comes from this line. But the bigger problem is: why is it 2015 and not 2018? To be more precise: we do give the edition to the parser, it just gets lost in the meantime...
Given a file:
compiling it with
rustc --edition 2018 temp.rs
works. Attempting to run the doc-test viarustdoc -Z unstable-options --edition 2018 --test temp.rs
gives:which is the same error that
rustc --edition 2015 temp.rs
gives.EDIT: Tested on versions:
The text was updated successfully, but these errors were encountered: