Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 18668f9

Browse files
authoredNov 17, 2019
Rollup merge of rust-lang#66238 - ehuss:stabilize-rustdoc-edition, r=GuillaumeGomez
rustdoc: Stabilize `edition` annotation. The rustdoc `edition` annotation is currently ignored on stable. This means that the tests will be ignored, unless there is a `rust` annotation, then it will use the global edition. I suspect this was just an oversight during the edition stabilization, but I don't know. Example: ```rust /// ```edition2018 /// // This code block was ignored on stable. /// ``` /// ```rust,edition2018 /// // This code block would use whatever edition is passed on the command line. /// ``` ``` AFAIK, it is not possible to write a test that verifies stable behavior, as all tests appear to set RUSTC_BOOTSTRAP which forces all tests to run as "nightly", even on a stable release. Closes rust-lang#65980
2 parents e0d2d9d + 1907589 commit 18668f9

File tree

2 files changed

+2
-4
lines changed

2 files changed

+2
-4
lines changed
 

‎src/librustdoc/html/markdown.rs

+1-3
Original file line numberDiff line numberDiff line change
@@ -680,9 +680,7 @@ impl LangString {
680680
seen_rust_tags = !seen_other_tags || seen_rust_tags;
681681
data.no_run = true;
682682
}
683-
x if allow_error_code_check && x.starts_with("edition") => {
684-
// allow_error_code_check is true if we're on nightly, which
685-
// is needed for edition support
683+
x if x.starts_with("edition") => {
686684
data.edition = x[7..].parse::<Edition>().ok();
687685
}
688686
x if allow_error_code_check && x.starts_with("E") && x.len() == 5 => {

‎src/test/rustdoc/edition-flag.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// compile-flags:--test -Z unstable-options
1+
// compile-flags:--test
22
// edition:2018
33

44
/// ```rust

0 commit comments

Comments
 (0)
Please sign in to comment.