rust/src/librustdoc
bors ab10778854 Auto merge of #80226 - ThePuzzlemaker:issue-80004-fix, r=jyn514,petrochenkov
Highlight edition-specific keywords correctly in code blocks, accounting for code block edition modifiers

Previously, edition-specific keywords (such as `async` and `await`) were not highlighted in code blocks, regardless of what edition was set. With this PR, this issue is fixed.

Now, the following behavior happens:
- When a code block is explicitly set to edition X, keywords from edition X are highlighted
- When a code block is explicitly set to a version that does not contain those keywords from edition X (e.g. edition Y), keywords from edition X are **not** highlighted
- When a code block has no explicit edition, keywords from the edition passed via `--edition` to rustdoc are highlighted

For example, a project set with `edition = "2015"` in its `Cargo.toml` would not highlight `async`/`await` unless the code block was set to `edition2018`. Additionally, a project set with `edition = "2018"` in its `Cargo.toml` *would* highlight `async`/`await` unless the code block was set to a version that did not contain those keywords (e.g. `edition2015`).

This PR fixes #80004.

r? `@jyn514`
2020-12-25 11:16:53 +00:00
..
clean Rollup merge of #80340 - jyn514:less-modules-attrs, r=GuillaumeGomez 2020-12-25 03:39:48 +01:00
doctest add an attribute to inner doctest fn 2020-12-20 10:43:26 +01:00
formats Make it compile 2020-12-17 11:36:04 -05:00
html Auto merge of #80226 - ThePuzzlemaker:issue-80004-fix, r=jyn514,petrochenkov 2020-12-25 11:16:53 +00:00
json Auto merge of #80099 - jyn514:visibility-on-demand, r=GuillaumeGomez 2020-12-23 06:39:15 +00:00
passes Rollup merge of #80274 - pierwill:lintlevelsource, r=petrochenkov 2020-12-25 03:39:36 +01:00
theme Add test to check if minified theme are handled correctly 2020-02-12 15:49:39 +01:00
Cargo.toml Simplfy color availability check 2020-11-17 10:33:14 +01:00
config.rs Dogfood 'str_split_once() with librustdoc 2020-12-07 14:00:31 -07:00
core.rs Fix error with --cfg parallel_compiler 2020-12-17 11:36:04 -05:00
docfs.rs Make all rustdoc functions and structs crate-private 2020-11-15 11:21:12 -05:00
doctest.rs add an attribute to inner doctest fn 2020-12-20 10:43:26 +01:00
doctree.rs Don't unnecessarily override attrs for Module 2020-12-23 15:25:30 -05:00
error.rs Make all rustdoc functions and structs crate-private 2020-11-15 11:21:12 -05:00
externalfiles.rs Make all rustdoc functions and structs crate-private 2020-11-15 11:21:12 -05:00
fold.rs Make fold_item_recur non-nullable 2020-11-22 12:59:01 -05:00
lib.rs Fix rebase conflict 2020-12-17 11:40:02 -05:00
markdown.rs Make all rustdoc functions and structs crate-private 2020-11-15 11:21:12 -05:00
README.md rust-lang.github.io/rustc-dev-guide -> rustc-dev-guide.rust-lang.org 2020-03-10 17:08:18 -03:00
theme.rs Make all rustdoc functions and structs crate-private 2020-11-15 11:21:12 -05:00
visit_ast.rs Don't unnecessarily override attrs for Module 2020-12-23 15:25:30 -05:00
visit_lib.rs Make all rustdoc functions and structs crate-private 2020-11-15 11:21:12 -05:00

For more information about how librustdoc works, see the rustc dev guide.