summary refs log tree commit diff
path: root/src/librustdoc
AgeCommit message (Collapse)AuthorLines
2019-09-13Account for doc comments coming from proc macros without spansEsteban Küber-13/+14
2019-08-11Reduce nesting in externalfiles implementationMark Rousskov-28/+14
Utilize `?` instead of and_then/map operators
2019-08-11Drop RefCell from IdMap in markdown renderingMark Rousskov-30/+21
2019-08-11Remove fmt::Display impls on Markdown structsMark Rousskov-38/+33
These impls prevent ergonomic use of the config (e.g., forcing us to use RefCell) despite all usecases for these structs only using their Display impls once.
2019-08-11Remove thread-local for playground configMark Rousskov-112/+141
2019-08-11Remove unnecessary channelMark Rousskov-6/+3
2019-08-11Use a HashSet instead of VecMark Rousskov-6/+4
2019-08-11Don't store all traits in DocContextMark Rousskov-7/+5
This is already a query so we're just needlessly copying the data around.
2019-08-11Store typed PassesMark Rousskov-68/+65
2019-08-11Replace Arc with Rc around external_traitsMark Rousskov-3/+2
2019-08-11Remove ReentrantMutexMark Rousskov-15/+9
This drops the parking_lot dependency; the ReentrantMutex type appeared to be unused (at least, no compilation failures occurred). This is technically a possible change in behavior of its users, as lock() would wait on other threads releasing their guards, but since we didn't actually remove any threading or such in this code, it appears that we never used that behavior (the behavior change is only noticeable if the type previously was used in two threads, in a single thread ReentrantMutex is useless).
2019-08-11Use entry API in store_pathMark Rousskov-6/+2
2019-08-11Remove crate_name from DocContextMark Rousskov-13/+8
tcx.crate_name is the appropriate way to retrieve the crate name.
2019-08-11Move def_id_to_path to use site in visit_astMark Rousskov-20/+19
2019-08-11rustdoc: Replace HirVec with slices in doctreeMark Rousskov-21/+21
2019-08-10Auto merge of #62955 - Mark-Simulacrum:rustdoc-clean-1, r=eddybbors-170/+81
rustdoc: general cleanups This is purely a refactoring, mostly just simplifying some of the code. Commits are best reviewed individually.
2019-08-10Implement Clean<Crate> on hir::Crate directlyMark Rousskov-11/+8
2019-08-10Replace is_doc_reachable with is_publicMark Rousskov-20/+7
2019-08-10Remove NodeId from doctree::ModuleMark Rousskov-10/+7
2019-08-10Gather deprecation information during cleaningMark Rousskov-56/+21
2019-08-10Gather stability information during cleaningMark Rousskov-55/+27
2019-08-10Make exact_paths a non-optional field on RustdocVisitorMark Rousskov-12/+11
Also privatizes needlessly public methods to enforce which methods callers are intended to call, i.e., only `new` and `visit`.
2019-08-10Represent ownership transfer in RustdocVisitor::visitMark Rousskov-5/+7
Previously visit could be called multiple times, but this is inaccurate, as it deconstructs Visitor state.
2019-08-10Remove Option from resolverMark Rousskov-5/+3
2019-08-10Make fields of RustdocVisitor privateMark Rousskov-15/+9
2019-08-10Fix calls to resolver from rustdoc and HIR loweringVadim Petrochenkov-13/+8
Cleanup some surrounding code. Support resolution of intra doc links in unnamed block scopes. (Paths from rustdoc now use early resolution and no longer need results of late resolution like all the built ribs.) Fix one test hitting file path limits on Windows.
2019-08-06Rollup merge of #63286 - Mark-Simulacrum:resolve-no-cb, r=petrochenkovMazdak Farrokhzad-0/+7
Replace error callback with Result r? @petrochenkov
2019-08-06Rollup merge of #62837 - Kinrany:patch-1, r=GuillaumeGomezMazdak Farrokhzad-7/+15
Fix theme picker blur handler: always hide instead of switching Fixes a minor bug in UI generated by rustdoc. For example, this page: https://doc.rust-lang.org/std/ Reproduction steps: 1. Click the theme picker twice * The list of themes will be shown and then hidden 2. Click anywhere else * The list of themes will be show again, which is unexpected The bug was caused by blur event handler toggling the state of the element instead of always hiding it regardless of the current state.
2019-08-06Rollup merge of #62821 - GuillaumeGomez:not-listed-methods, r=Mark-SimulacrumMazdak Farrokhzad-3/+5
Not listed methods Fixes #60326. cc @rust-lang/rustdoc r? @QuietMisdreavus
2019-08-06Rollup merge of #63272 - Mark-Simulacrum:clean-attr, r=petrochenkovMazdak Farrokhzad-1/+0
Some more libsyntax::attr cleanup Much smaller patch than the last one, mostly just finishing up by removing some Span arguments. r? @petrochenkov
2019-08-05Display methods from DerefMut in the sidebar as wellGuillaume Gomez-3/+5
2019-08-05Force callers of resolve_ast_path to deal with Res::Err correctlyMark Rousskov-0/+7
2019-08-05Drop explicit span argument from mk_name_value_itemMark Rousskov-1/+0
2019-08-05adapt rustdoc to infailable lexerAleksey Kladov-36/+23
2019-08-05add unknown tokenAleksey Kladov-1/+1
2019-08-04Rename `ItemImplKind::Type` to `ItemImplKind::TyAlias`varkor-1/+1
2019-08-04Rename `ItemKind::Ty` to `ItemKind::TyAlias`varkor-2/+2
2019-08-04Auto merge of #63048 - Aaron1011:feature/rustdoc-reexport-doc, r=GuillaumeGomezbors-24/+60
Use doc comments from 'pub use' statements Split off from #62855 Currently, rustdoc ignores any doc comments found on 'pub use' statements. As described in issue #58700, this makes it impossible to properly document procedural macros. Any doc comments must be written on the procedural macro definition, which must occur in a dedicated proc-macro crate. This means that any doc comments or doc tests cannot reference items defined in re-exporting crate, despite the fact that such items may be required to use the procedural macro. To solve this issue, this commit allows doc comments to be written on 'pub use' statements. For consistency, this applies to *all* 'pub use' statements, not just those importing procedural macros. When inlining documentation, documentation on 'pub use' statements will be prepended to the documentation of the inlined item. For example, the following items: ```rust mod other_mod { /// Doc comment from definition pub struct MyStruct; } /// Doc comment from 'pub use' /// pub use other_mod::MyStruct; ``` will caues the documentation for the re-export of 'MyStruct' to be rendered as: ``` Doc comment from 'pub use' Doc comment from definition ``` Note the empty line in the 'pub use' doc comments - because doc comments are concatenated as-is, this ensure that the doc comments on the definition start on a new line.
2019-08-03Auto merge of #63180 - varkor:trait-alias-impl-trait, r=Centrilbors-35/+35
Change opaque type syntax from `existential type` to type alias `impl Trait` This implements a new feature gate `type_alias_impl_trait` (this is slightly different from the originally proposed feature name, but matches what has been used in discussion since), deprecating the old `existential_types` feature. The syntax for opaque types has been changed. In addition, the "existential" terminology has been replaced with "opaque", as per previous discussion and the RFC. This makes partial progress towards implementing https://github.com/rust-lang/rust/issues/63063. r? @Centril
2019-08-02Replace `exist_ty` and `ExistTy` with `opaque_ty` and `OpaqueTy`varkor-4/+4
2019-08-02Fix fallout after rebasevarkor-1/+1
2019-08-02Replace "existential" by "opaque"varkor-32/+32
2019-08-02librustdoc: Unconfigure tests during normal buildVadim Petrochenkov-653/+651
2019-08-01Rollup merge of #62971 - GuillaumeGomez:keyword-sidebar, r=nobodyPietro Albini-1/+2
Add keywords item into the sidebar Fixes #62939. cc @pravic screenshot of the result: ![Screenshot from 2019-07-25 14-29-48](https://user-images.githubusercontent.com/3050060/61874545-f9512080-aee8-11e9-8e8b-aa50216aec94.png) r? @QuietMisdreavus
2019-07-30Auto merge of #62766 - alexcrichton:stabilize-pipelined-compilation, r=oli-obkbors-32/+10
rustc: Stabilize options for pipelined compilation This commit stabilizes options in the compiler necessary for Cargo to enable "pipelined compilation" by default. The concept of pipelined compilation, how it's implemented, and what it means for rustc are documented in #60988. This PR is coupled with a PR against Cargo (rust-lang/cargo#7143) which updates Cargo's support for pipelined compliation to rustc, and also enables support by default in Cargo. (note that the Cargo PR cannot land until this one against rustc lands). The technical changes performed here were to stabilize the functionality proposed in #60419 and #60987, the underlying pieces to enable pipelined compilation support in Cargo. The issues have had some discussion during stabilization, but the newly stabilized surface area here is: * A new `--json` flag was added to the compiler. * The `--json` flag can be passed multiple times. * The value of the `--json` flag is a comma-separated list of directives. * The `--json` flag cannot be combined with `--color` * The `--json` flag must be combined with `--error-format=json` * The acceptable list of directives to `--json` are: * `diagnostic-short` - the `rendered` field of diagnostics will have a "short" rendering matching `--error-format=short` * `diagnostic-rendered-ansi` - the `rendered` field of diagnostics will be colorized with ansi color codes embedded in the string field * `artifacts` - JSON blobs will be emitted for artifacts being emitted by the compiler The unstable `-Z emit-artifact-notifications` and `--json-rendered` flags have also been removed during this commit as well. Closes #60419 Closes #60987 Closes #60988
2019-07-28Auto merge of #63090 - Centril:rollup-xnjwm2h, r=Centrilbors-5/+5
Rollup of 8 pull requests Successful merges: - #61856 (Lint attributes on function arguments) - #62360 (Document that ManuallyDrop::drop should not called more than once) - #62392 (Update minifier-rs version) - #62871 (Explicit error message for async recursion.) - #62995 (Avoid ICE when suggestion span is at Eof) - #63053 (SystemTime docs: recommend Instant for elapsed time) - #63081 (tidy: Cleanup the directory whitelist) - #63088 (Remove anonymous_parameters from unrelated test) Failed merges: r? @ghost
2019-07-28Update minifier-rs versionGuillaume Gomez-5/+5
2019-07-28Deny `unused_lifetimes` through rustbuildVadim Petrochenkov-2/+0
2019-07-28Remove lint annotations in specific crates that are already enforced by ↵Vadim Petrochenkov-1/+0
rustbuild Remove some random unnecessary lint `allow`s
2019-07-27Use doc comments from 'pub use' statementsAaron Hill-24/+60
Split off from #62855 Currently, rustdoc ignores any doc comments found on 'pub use' statements. As described in issue #58700, this makes it impossible to properly document procedural macros. Any doc comments must be written on the procedural macro definition, which must occur in a dedicated proc-macro crate. This means that any doc comments or doc tests cannot reference items defined in re-exporting crate, despite the fact that such items may be required to use the procedural macro. To solve this issue, this commit allows doc comments to be written on 'pub use' statements. For consistency, this applies to *all* 'pub use' statements, not just those importing procedural macros. When inlining documentation, documentation on 'pub use' statements will be prepended to the documentation of the inlined item. For example, the following items: ```rust mod other_mod { /// Doc comment from definition pub struct MyStruct; } /// Doc comment from 'pub use' /// pub use other_mod::MyStruct; ``` will caues the documentation for the re-export of 'MyStruct' to be rendered as: ``` Doc comment from 'pub use' Doc comment from definition ``` Note the empty line in the 'pub use' doc comments - because doc comments are concatenated as-is, this ensure that the doc comments on the definition start on a new line.