Commit Graph

5315 Commits

Author SHA1 Message Date
Guillaume Gomez 35ba58f5a9 Remove minification on search-index.js file 2019-12-02 10:25:36 +01:00
Guillaume Gomez 5748b4ce95 Add missing check 2019-12-02 10:25:36 +01:00
Mazdak Farrokhzad b772b5b19d
Rollup merge of #66895 - Centril:rustc_feature, r=oli-obk
Feature gating *declarations* => new crate `rustc_feature`

This PR moves the data-oriented parts of feature gating into its own crate, `rustc_feature`.
The parts consist of some data types as well as `accepted`, `active`, `removed`, and `builtin_attrs`.

Feature gate checking itself remains in `syntax::feature_gate::check`. The parts which define how to emit feature gate errors could probably be moved to `rustc_errors` or to the new `rustc_session` crate introduced in #66878. The visitor itself could probably be moved as a pass in `rustc_passes` depending on how the dependency edges work out.

The PR also contains some drive-by cleanup of feature gate checking. As such, the PR probably best read commit-by-commit.

r? @oli-obk
cc @petrochenkov
cc @Mark-Simulacrum
2019-11-30 16:56:58 +01:00
Mazdak Farrokhzad b45f21d38e move UnstableFeatures -> rustc_feature 2019-11-30 02:50:47 +01:00
Mazdak Farrokhzad 3d080a4a77 introduce crate rustc_feature and move active, accepted, and removed to it 2019-11-30 00:25:40 +01:00
Ralf Jung 6ea1df2340
Rollup merge of #66791 - cjgillot:arena, r=Mark-Simulacrum
Handle GlobalCtxt directly from librustc_interface query system

This PR constructs the `GlobalCtxt` as a member of the `Queries` in librustc_interface.
This simplifies the code to construct it, at the expense of added complexity in the query control flow.
This allows to handle the arenas directly from librustc_interface.

Based on #66707

r? @Zoxc
2019-11-29 22:57:34 +01:00
Vadim Petrochenkov 753ce4518e rustc_metadata: Merge `cstore.rs` into `creader.rs` 2019-11-28 20:59:56 +03:00
Guillaume Gomez 97c427cc5e Use new ErrorKind enum 2019-11-27 14:28:20 +01:00
Guillaume Gomez b91a6fcd5d Replace Iterator::find calls with Iterator::any when better 2019-11-27 13:13:16 +01:00
Guillaume Gomez 4ab8aa3700 Add support for intra-doc link fields of enum variant 2019-11-27 13:13:16 +01:00
Guillaume Gomez 4993807dd9 little intra-doc code cleanup 2019-11-27 13:12:27 +01:00
bors b5f265eeed Auto merge of #66675 - GuillaumeGomez:support-anchors-intra-doc-links, r=kinnison
Support anchors intra doc links

Fixes #62833
Part of #43466.

cc @ollie27
r? @kinnison
2019-11-27 04:51:31 +00:00
Tyler Mandry bb6236cd74
Rollup merge of #66754 - estebank:rustdoc-capitalization, r=Dylan-DPC
Various tweaks to diagnostic output
2019-11-26 17:56:19 -06:00
Camille GILLOT b99513be57 Have Queries own the GlobalCtxt.
The construction of the GlobalCtxt is moved from a generator's stack to
the Queries struct.  Since the GlobalCtxt requires the HIR Forest and the
arenas to live longer, those are moved into Queries the same way.

The resulting handling of objects is more brittle, because consumers of
the Once objects need to be careful of their initialisation.
2019-11-26 22:51:02 +01:00
Camille GILLOT 144d1c2171 Review nits. 2019-11-26 17:20:32 +01:00
Camille GILLOT 68b1ac9874 Reduce righward drift. 2019-11-26 12:23:35 +01:00
Camille GILLOT 8ffc9444a3 Don't move stuff out of Compiler::enter. 2019-11-25 18:36:05 +01:00
Camille GILLOT ea1b8039ad Pass Queries by reference. 2019-11-25 18:13:29 +01:00
Pietro Albini 7520f6da69
Rollup merge of #65613 - Mark-Simulacrum:rustdoc-preserve-ws, r=GuillaumeGomez
Preserve whitespace inside one-backtick codeblocks

Previously this was only done inside short docblocks (e.g., summary
lines), but we should also do so in general.

Fixes #65555
2019-11-25 15:05:11 +01:00
Guillaume Gomez c1ea1fd2b0 Update error messages 2019-11-25 14:24:53 +01:00
Esteban Küber e5816a75cc Fix some rustdoc error capitalization 2019-11-24 18:42:22 -08:00
Camille GILLOT 27513a21c4 Tidy. 2019-11-24 23:21:44 +01:00
Camille GILLOT 266ede1bb3 Isolate compiler queries inside the Queries type. 2019-11-24 23:21:43 +01:00
Mazdak Farrokhzad 0bb06cbea9
Rollup merge of #66657 - ollie27:rustdoc_flock_panic, r=GuillaumeGomez
rustdoc: Don't panic when failing to write .lock file

It can be treated like any other unexpected IO error.

I couldn't think of a good way to add a test for this unfortunately.

r? @GuillaumeGomez
2019-11-23 23:22:38 +01:00
Mazdak Farrokhzad 8ad3b5ccca
Rollup merge of #66655 - ollie27:rustdoc_extern-private_unstable, r=GuillaumeGomez
rustdoc: Mark `--extern-private` as unstable

It's not even stable in rustc so it shouldn't be stable in rustdoc.

r? @kinnison
2019-11-23 23:22:36 +01:00
Mazdak Farrokhzad 6618af2c5c
Rollup merge of #61351 - GuillaumeGomez:stabilize-cfg-rustdoc, r=QuietMisdreavus
Stabilize cfg(doc)

cc #43781.
2019-11-23 23:22:33 +01:00
Guillaume Gomez 454d13badf Handle anchor errors 2019-11-23 18:46:07 +01:00
Guillaume Gomez 09293bec92 Handle anchors in intra doc links 2019-11-23 16:21:29 +01:00
Oliver Middleton 05ef20f922 rustdoc: Don't panic when failing to write .lock file
It can be treated like any other unexpected IO error.
2019-11-23 02:08:10 +00:00
Oliver Middleton 4fcb3384ad rustdoc: Mark `--extern-private` as unstable
It's not even stable in rustc so it shouldn't be stable in rustdoc.
2019-11-23 00:15:39 +00:00
bors eaac45a9a9 Auto merge of #66565 - Mark-Simulacrum:syntax-cfg-mod, r=petrochenkov
Move process_configure_mod to rustc_parse

This removes the hack in favor of perhaps a less principled, but less painful, approach.

This also supports my work to decouple `Session` from librustc, as `ParseSess` currently has `Attribute` as "part" of it but after this PR will no longer do so.
2019-11-22 10:33:29 +00:00
Guillaume Gomez a056bf9714 Rename the cfg attribute from rustdoc to doc 2019-11-21 15:38:30 +01:00
Mazdak Farrokhzad 5ab2bccbcd
Rollup merge of #66602 - GuillaumeGomez:revert-font, r=GuillaumeGomez
Revert "Update Source Code Pro and include italics"

This reverts commit ea9519bf16.
2019-11-21 15:29:08 +01:00
Mazdak Farrokhzad 15c30ddd69 Stabilize the `never_type`, written `!`. 2019-11-21 14:55:32 +01:00
Guillaume Gomez d0b67ddc0f Revert "Update Source Code Pro and include italics"
This reverts commit ea9519bf16.
2019-11-21 11:18:23 +01:00
Mark Rousskov 70805e6444 Delete ProcessCfgMod
The previous commit removes the use of this, and now we cleanup.
2019-11-20 14:07:57 -05:00
Mazdak Farrokhzad 4bd9168d7f
Rollup merge of #66514 - GuillaumeGomez:fix-search-filter-save, r=kinnison
Fix selected crate search filter

Fixes #62929.

r? @kinnison
2019-11-20 18:32:10 +01:00
Mazdak Farrokhzad 00cbc75c74
Rollup merge of #66298 - Ppjet6:disable-search-field, r=GuillaumeGomez
rustdoc: fixes #64305: disable search field instead of hidding it

The result seems to be ok but I wasn't entirely sure how to get there. I tried to stay generic a bit but maybe it's not required at all.

@GuillaumeGomez

Signed-off-by: Maxime “pep” Buquet <pep@bouah.net>
2019-11-20 18:32:06 +01:00
Mazdak Farrokhzad 423137b779
Rollup merge of #65665 - tspiteri:italic-and-update-SourceCodePro, r=GuillaumeGomez
Update Source Code Pro and include italics

Fixes #65502.

A few notes:
  * As stated in #65502, this does increase the download size.
  * Since this PR changes the font set, I think docs.rs would have to be updated if this PR is merged.
  * The fonts have a double extension (.ttf.woff); this is to keep the names consistent with the upstream font release which does that to distinguish these from the .otf.woff files ([Source Code Pro otf renders poorly on older Windows system apps](https://github.com/adobe-fonts/source-code-pro/issues/25#issuecomment-9019600)).
2019-11-20 12:58:26 +01:00
Guillaume Gomez 572133845a Change background-color of search input if disabled 2019-11-20 12:57:47 +01:00
Maxime “pep” Buquet 5cbd406a14 rustdoc: fixes #64305: disable search field instead of hidding it
Signed-off-by: Maxime “pep” Buquet <pep@bouah.net>
2019-11-20 11:32:58 +01:00
Mazdak Farrokhzad 95b9766e0a
Rollup merge of #66430 - dns2utf8:fix_code_selection_click_handler, r=GuillaumeGomez
[doc] Fix the source code highlighting on source comments

The code would always forget the previous selection.

r? @GuillaumeGomez
2019-11-19 13:10:15 +01:00
bors 3e525e3f6d Auto merge of #54733 - GuillaumeGomez:stabilize-rustdoc-theme, r=ollie27,Dylan-DPC
Stabilize rustdoc theme options

Closes #54730

This PR stabilizes the `--themes` (now `--theme`) and `--theme-checker` (now `--check-theme`) options, for allowing users to add custom themes to their documentation.

Rustdoc includes two themes by default: `light` and `dark`. Using the `--theme` option, you can give rustdoc a CSS file to include as an extra theme for that render. Themes are named after the CSS file used, so using `--theme /path/to/your/custom-theme.css` will add a theme called `custom-theme` to the documentation.

Even though the CLI flag to add a theme is getting stabilized, there's no guarantee that a theme file will always have the same effect on documentation generated with future versions of rustdoc. To aid in ensuring that a theme will work, the flag `--check-theme` is also available, which compares the CSS rules defined by a custom theme against the ones used in the `light` theme. If the `light` theme defines a CSS rule that the custom theme does not, rustdoc will report an error. (Rustdoc also performs this check for themes given to `--theme`, but only reports a warning when a difference is found.)
2019-11-18 19:03:21 +00:00
Guillaume Gomez 71c7dace89 improve error messages and documentation 2019-11-18 16:43:48 +01:00
Guillaume Gomez 530d866aef Apply review comments 2019-11-18 16:43:48 +01:00
Guillaume Gomez 8f9014d98f Rename rustdoc options --themes and --check-themes to --theme and --check-theme 2019-11-18 16:43:48 +01:00
Guillaume Gomez 7cbf31aa04 rename check-theme option into check-themes 2019-11-18 16:43:48 +01:00
Guillaume Gomez bbfd63c89a Improve documentation, add checks for themes option arguments, make sure the themes file names are js compatible 2019-11-18 16:43:48 +01:00
Guillaume Gomez 8f44c604d2 Rename theme-checker option to check-theme 2019-11-18 16:43:48 +01:00
Guillaume Gomez 82872addf1 Add sentence to tell other options are ignored when running check-theme 2019-11-18 16:43:48 +01:00
Guillaume Gomez e365120243 Prevent invalid html characters in themes name 2019-11-18 16:43:48 +01:00
Guillaume Gomez f3e4279ccc Apply review comments 2019-11-18 16:43:47 +01:00
Guillaume Gomez dcccd28e42 Warn instead of failing for themes 2019-11-18 16:43:47 +01:00
Guillaume Gomez add6204484 Stabilize rustdoc theme options 2019-11-18 16:43:47 +01:00
Guillaume Gomez 00ef5c1b98 Fix selected crate search filter 2019-11-18 14:15:00 +01:00
bors d67ca28354 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
2019-11-18 03:06:42 +00:00
Yuki Okushi 6e6c46c694
Rollup merge of #66456 - Centril:driver-codes, r=Mark-Simulacrum
Move `DIAGNOSTICS` usage to `rustc_driver`

Remove `rustc_interface`'s dependency on `rustc_error_codes` and centralize all usages of `DIAGNOSTICS` in `rustc_driver`. Once we remove all references to `rustc_error_codes` in all other crates but `rustc_driver`, this should allow for incremental recompilation of the compiler to be smoother when tweaking error codes. This works towards https://github.com/rust-lang/rust/issues/66210#issuecomment-551862528.

(May include traces of minor drive-by cleanup.)

r? @Mark-Simulacrum
2019-11-17 13:36:18 +09:00
Mazdak Farrokhzad 8444e1628c move DIAGNOSTICS usage to rustc_driver 2019-11-16 02:32:33 +01:00
Mazdak Farrokhzad ae0c8b5f09
Rollup merge of #66427 - Mark-Simulacrum:errors-json, r=Centril
Move the JSON error emitter to librustc_errors

This is done both as a cleanup (it makes little sense for this emitter to be in libsyntax), but also as part of broader work to decouple Session from librustc itself.

Along the way, this also moves SourceMap to syntax_pos, which is also nice for the above reasons, as well as allowing dropping the SourceMapper trait from code. This had the unfortunate side-effect of moving `FatalError` to rustc_data_structures (it's needed in syntax_pos, due to SourceMap, but putting it there feels somehow worse).
2019-11-15 18:02:02 +01:00
Mark Rousskov c31a8754e3 Move JSON emitter to rustc_errors 2019-11-15 08:45:49 -05:00
Stefan Schindler 1bbb8168ec Prevent jumps when selecting one or many lines 2019-11-15 02:30:44 +01:00
Stefan Schindler 71cf364c3c Fix the source code highlighting on source comments 2019-11-15 02:02:09 +01:00
Stefan Schindler cee0403b5c Code cleanup to remove douplacte var definition
Also move the declaration outside the loop since they accumulate state with each iteration
2019-11-15 00:45:08 +01:00
Stefan Schindler e3afe6ac23 Remove unused argument 2019-11-15 00:27:53 +01:00
bors 5e380b797b Auto merge of #66233 - cjgillot:constkind, r=oli-obk
Split ConstValue into two enums

Hello,

Issue #59210 appeared abandoned, so I gave it a go.
Some further cleanup and refactoring may be mandated.

I did not test beyond `x.py check`, since my home computer dies compiling librustc.

Fixes #59210
2019-11-14 04:54:51 +00:00
bors 3f07f1cd78 Auto merge of #66211 - kinnison:kinnison/fix-66159, r=GuillaumeGomez
Fix ICE when documentation includes intra-doc-link

When collecting intra-doc-links we could trigger the loading of extra crates into the crate store due to name resolution finding crates referred to in documentation but not in code.  This might be due to
configuration differences or simply referring to something else.

This would cause an ICE because the newly loaded crate metadata existed in a crate store associated with the rustdoc global context, but the resolver had its own crate store cloned just before the documentation processing began and as such it could try and look up crates in a store which lacked them.

In this PR, I add support for `--extern-private` to the `rustdoc` tool so that it is supported for `compiletest` to then pass the crates in; and then I fix the issue by forcing the resolver to look over all the crates before we then lower the input ready for processing into documentation.

The first commit (the `--extern-private`) could be replaced with a commit which adds support for `--extern` to `compiletest` if preferred, though I think that adding `--extern-private` to `rustdoc` is more useful anyway since it makes the CLI a little more like `rustc`'s which might help reduce surprise for someone running it by hand or in their own test code.

The PR is meant to fix #66159 though it may also fix #65840.

cc @GuillaumeGomez
2019-11-13 23:22:03 +00:00
Yuki Okushi c75a48a924
Rollup merge of #66297 - vakaras:edit-queries, r=oli-obk
Add a callback that allows compiler consumers to override queries.

This pull request adds an additional callback that allows compiler consumers such as Prusti and MIRAI to override queries. My hope is that in this way it will be possible to get access to the internal compiler information (e.g. borrow checker) without major changes to the compiler.

This pull request is work in progress because I am still testing if I can get the information which I need.

cc @nikomatsakis

r? @oli-obk
2019-11-13 22:09:22 +09:00
Yuki Okushi 6eea5001b5
Rollup merge of #66166 - GuillaumeGomez:rename-rustdoc-to-doc, r=QuietMisdreavus
rename cfg(rustdoc) into cfg(doc)

Needed by https://github.com/rust-lang/rust/pull/61351

r? @QuietMisdreavus
2019-11-13 22:09:13 +09:00
Camille GILLOT 3ebfa1856e Rename in librustdoc. 2019-11-12 20:50:47 +01:00
Yuki Okushi 4134a4acf5
Rollup merge of #66299 - rossmacarthur:fix-41260-avoid-issue-0, r=varkor
support issue = "none" in unstable attributes

This works towards fixing #41260.

This PR allows the use of `issue = "none"` in unstable attributes and makes changes to internally store the issue number as an `Option<NonZeroU32>`. For example:

```rust
#[unstable(feature = "unstable_test_feature", issue = "none")]
fn unstable_issue_none() {}
```

It was not made optional because feedback seen here #60860 suggested that people might forget the issue field if it was optional.

I could not remove the current uses of `issue = "0"` (of which there are a lot) because the stage 0 compiler expects the old syntax. Once this is available in the stage 0 compiler we can replace all uses of `"0"` with `"none"` and no longer allow `"0"`. This is my first time contributing, so I'm not sure what the protocol is with two-part things like this, so some guidance would be appreciated.

r? @varkor
2019-11-12 16:36:16 +09:00
Vytautas Astrauskas f9f5a88bc4 Add a callback that allows compiler consumers to override queries. 2019-11-11 19:29:34 +01:00
Ross MacArthur 3ba8257253 support issue = "none" in unstable attributes
- Use `Option<NonZeroU32>` to represent issue numbers.
2019-11-11 19:33:30 +02:00
bors 56237d75b4 Auto merge of #66252 - cjgillot:trees, r=oli-obk
Merge repeated definitions

Step forward on #66149

I may need further context to understand the need for a separate crate.

Also, please tell me if you think of other definitions to merge.
2019-11-11 14:05:43 +00:00
Camille GILLOT ed640c6a27 Merge hir::Mutability into ast::Mutability. 2019-11-10 12:21:05 +01:00
Mazdak Farrokhzad 4ae2728fa8 move syntax::parse -> librustc_parse
also move MACRO_ARGUMENTS -> librustc_parse
2019-11-10 03:57:18 +01:00
Mazdak Farrokhzad be023ebe85 move config.rs to libsyntax_expand 2019-11-10 02:46:17 +01:00
Eric Huss 1907589fbb rustdoc: Stabilize `edition` annotation. 2019-11-08 16:15:17 -08:00
Mazdak Farrokhzad 27511b22df hir::MethodSig -> hir::FnSig 2019-11-08 09:32:20 +01:00
Mazdak Farrokhzad 30d7279628 hir::ItemKind::Fn: use hir::MethodSig 2019-11-08 09:32:20 +01:00
Daniel Silverstone 33ded3ec7f
rustdoc: Deliberately load extern crates before processing docs
In order that we can successfully later resolve paths in crates
which weren't loaded as a result of merely parsing the crate
we're documenting, we force the resolution of the path to each
crate before cloning the resolver to use later.  Closes #66159

Signed-off-by: Daniel Silverstone <dsilvers@digital-scurf.org>
2019-11-08 07:41:40 +00:00
Daniel Silverstone 2c33568a77
rustdoc: Support --extern-private but treat as --extern
This makes `rustdoc` support `--extern-private` but treats it
the same as `--extern` which is useful for making the CLI more
similar to `rustc` to ease test suite integration.

Signed-off-by: Daniel Silverstone <dsilvers@digital-scurf.org>
2019-11-08 07:31:24 +00:00
Yuki Okushi 392ebad5c6
Rollup merge of #66123 - GuillaumeGomez:no-more-hidden-elements, r=Dylan-DPC
No more hidden elements

Fixes #66046.

Follow-up of #66082.

r? @kinnison
2019-11-08 13:42:19 +09:00
bors d2574403b3 Auto merge of #64882 - ehuss:stabilize-bare-extern, r=eddyb
Stabilize --extern flag without a path.

This stabilizes the `--extern` flag without a path, implemented in #54116.

This flag is used to add a crate that may be found in the search path to the extern prelude. The intent of stabilizing this now is to change Cargo to emit this flag for `proc_macro` when building a proc-macro crate. This will allow the ability to elide `extern crate proc_macro;` for proc-macros, one of the few places where it is still necessary.

It is intended that Cargo may also use this flag for other cases in the future as part of the [std-aware work](https://github.com/rust-lang/wg-cargo-std-aware/). There will likely be some kind of syntax where users may declare dependencies on other crates (such as `alloc`), and Cargo will use this flag so that they may be used like any other crate. At this time there are no short-term plans to use it for anything other than proc-macro.

This will not help for non-proc-macro crates that use `proc_macro`, which I believe is not too common?

An alternate approach for proc-macro is to use the `meta` crate, but from my inquiries there doesn't appear to be anyone interested in pushing that forward. The `meta` crate also doesn't help with things like `alloc` or `test`.

cc #57288
2019-11-08 01:15:50 +00:00
Eric Huss 4bf411ea6d Update built-in help for --extern. 2019-11-07 05:51:17 -08:00
Eric Huss b47e3d8fe4 Stabilize --extern flag without a path. 2019-11-07 05:51:17 -08:00
Mazdak Farrokhzad 28c1136970
Rollup merge of #65916 - Centril:split-syntax-3, r=davidtwco
syntax: move stuff around

Part of https://github.com/rust-lang/rust/pull/65324.

r? @davidtwco
cc @estebank @petrochenkov
2019-11-07 14:27:23 +01:00
Mazdak Farrokhzad 59e79ff137
Rollup merge of #64696 - GuillaumeGomez:rustdoc-sub-settings, r=kinnison
[rustdoc] add sub settings

This PR is to give a finer control over what types are automatically expanded or not as well as the possibility to add sub-settings in the settings page.

![Screenshot from 2019-09-23 00-46-14](https://user-images.githubusercontent.com/3050060/65395521-15aff300-dd9c-11e9-9437-429ca347d455.png)

r? @Mark-Simulacrum
2019-11-07 14:27:21 +01:00
Mazdak Farrokhzad 27f97aa468 move syntax::parse::lexer::comments -> syntax::util::comments 2019-11-07 13:59:13 +01:00
Mazdak Farrokhzad 9d6768a478 syntax::parser::token -> syntax::token 2019-11-07 13:50:12 +01:00
Guillaume Gomez d4527b7e00 Only call onHashChange instead of both functions 2019-11-07 10:39:53 +01:00
Guillaume Gomez 24e093c5c3 Remove old isHidden function 2019-11-07 10:13:44 +01:00
Mazdak Farrokhzad d7f1406378
Rollup merge of #59789 - eddyb:typeck-reverts, r=nikomatsakis
Revert two unapproved changes to rustc_typeck.

There was a breakdown in process (https://github.com/rust-lang/rust/pull/59004#issuecomment-477600735, https://github.com/rust-lang/rust/pull/58894#discussion_r272795560) and two changes were made to `rustc_typeck`'s "collect" queries, for rustdoc, that were neither needed *nor* correct.
I'm reverting them here, and will fix up rustdoc *somehow*, if necessary.

cc @rust-lang/compiler How do we ensure this doesn't happen again?

r? @nikomatsakis or @oli-obk
2019-11-07 08:51:52 +01:00
Guillaume Gomez 0282c27781 rename cfg(rustdoc) into cfg(doc) 2019-11-06 18:32:51 +01:00
Nicholas Nethercote eea6f23a0e Make doc comments cheaper with `AttrKind`.
`AttrKind` is a new type with two variants, `Normal` and `DocComment`. It's a
big performance win (over 10% in some cases) because `DocComment` lets doc
comments (which are common) be represented very cheaply.

`Attribute` gets some new helper methods to ease the transition:
- `has_name()`: check if the attribute name matches a single `Symbol`; for
  `DocComment` variants it succeeds if the symbol is `sym::doc`.
- `is_doc_comment()`: check if it has a `DocComment` kind.
- `{get,unwrap}_normal_item()`: extract the item from a `Normal` variant;
  panic otherwise.

Fixes #60935.
2019-11-06 23:05:07 +11:00
Guillaume Gomez f66a331335 When a URL hash refers to a hidden element, it makes the element visible 2019-11-06 10:10:56 +01:00
Mazdak Farrokhzad a0b4b4dafa
Rollup merge of #65776 - nnethercote:rename-LocalInternedString-and-more, r=estebank
Rename `LocalInternedString` and more

This PR renames `LocalInternedString` as `SymbolStr`, removes an unnecessary `impl` from it, improves comments, and cleans up some `SymbolStr` uses.

r? @estebank
2019-11-06 07:03:01 +01:00
Mazdak Farrokhzad f5c54896b9
Rollup merge of #66068 - euclio:null-emitter, r=estebank
use silent emitter for rustdoc highlighting pass

Partially addresses #63284.
2019-11-06 03:28:11 +01:00
Guillaume Gomez 1c78af7de2 clean highlightSourceLines code 2019-11-04 13:28:50 +01:00
Guillaume Gomez 8784b074e7 Change sub-setting CSS class to sub-settings 2019-11-04 11:39:00 +01:00
Andy Russell d06a4ded13
use silent emitter for rustdoc highlighting pass 2019-11-03 22:19:34 -05:00