diff options
| author | bors <bors@rust-lang.org> | 2019-11-18 03:06:42 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2019-11-18 03:06:42 +0000 |
| commit | d67ca28354091f4597b03efef2aebb4b6b55e92e (patch) | |
| tree | d2aa966834a60dc5993e1f7d0acff0fa18f40a78 /src | |
| parent | 361791bb5fdd714bdc39f8af835f6468dd18331d (diff) | |
| parent | 1907589fbb87e63b2c93808f485f021d2cc81ca5 (diff) | |
| download | rust-d67ca28354091f4597b03efef2aebb4b6b55e92e.tar.gz rust-d67ca28354091f4597b03efef2aebb4b6b55e92e.zip | |
Auto merge of #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 #65980
Diffstat (limited to 'src')
| -rw-r--r-- | src/librustdoc/html/markdown.rs | 4 | ||||
| -rw-r--r-- | src/test/rustdoc/edition-flag.rs | 2 |
2 files changed, 2 insertions, 4 deletions
diff --git a/src/librustdoc/html/markdown.rs b/src/librustdoc/html/markdown.rs index 9ff1e1d3119..fc4dc52f127 100644 --- a/src/librustdoc/html/markdown.rs +++ b/src/librustdoc/html/markdown.rs @@ -680,9 +680,7 @@ impl LangString { seen_rust_tags = !seen_other_tags || seen_rust_tags; data.no_run = true; } - x if allow_error_code_check && x.starts_with("edition") => { - // allow_error_code_check is true if we're on nightly, which - // is needed for edition support + x if x.starts_with("edition") => { data.edition = x[7..].parse::<Edition>().ok(); } x if allow_error_code_check && x.starts_with("E") && x.len() == 5 => { diff --git a/src/test/rustdoc/edition-flag.rs b/src/test/rustdoc/edition-flag.rs index ddbc2be651d..e54c7d2969b 100644 --- a/src/test/rustdoc/edition-flag.rs +++ b/src/test/rustdoc/edition-flag.rs @@ -1,4 +1,4 @@ -// compile-flags:--test -Z unstable-options +// compile-flags:--test // edition:2018 /// ```rust |
