summary refs log tree commit diff
path: root/src/librustdoc/clean
AgeCommit message (Collapse)AuthorLines
2020-10-02Rollup merge of #76811 - GuillaumeGomez:doc-alias-name-restriction, ↵Jonas Schievink-1/+1
r=oli-obk,ollie27 Doc alias name restriction Fixes #76705.
2020-10-02Remove unneeded replaceGuillaume Gomez-1/+1
2020-09-25Rename `whence` to `span`Camelid-19/+19
It's called `span` elsewhere in the compiler and `span` is also less surprising. `whence` is whimsical, but not super clear :)
2020-09-21Rollup merge of #76783 - lzutao:rd_impl_kind, r=GuillaumeGomezecstatic-morse-19/+22
Only get ImplKind::Impl once With this, the code panics in one place instead of two.
2020-09-18Auto merge of #76782 - lzutao:rd-cap, r=jyn514bors-6/+8
Specialize merge_attrs in good case Just a non-important micro-optimization. r? `@jyn514`
2020-09-18Calculate more correct capacity in merge_attrsLzu Tao-6/+8
Co-authored-by: jyn514 <joshua@yottadb.com>
2020-09-16Only get ImplKind::Impl onceLzu Tao-19/+22
2020-09-16Rollup merge of #76641 - nox:pointee-random-stuff, r=eddybRalf Jung-1/+1
Some cleanup changes and commenting r? @nikomatsakis Cc @eddyb
2020-09-14Auto merge of #76571 - lzutao:rustdoc-private-traits, r=jyn514bors-9/+10
Ignore rustc_private items from std docs By ignoring rustc_private items for non local impl block, this may fix #74672 and fix #75588 . This might suppress #76529 if it is simple enough for backport.
2020-09-13allow concrete self types in constsBastian Kauschke-1/+1
2020-09-13Auto merge of #76244 - vandenheuvel:remove__paramenv__def_id, r=nikomatsakisbors-1/+2
Removing the `def_id` field from hot `ParamEnv` to make it smaller This PR addresses https://github.com/rust-lang/rust/issues/74865.
2020-09-13Auto merge of #76623 - slightlyoutofphase:master, r=jyn514bors-5/+7
Use `is_unstable_const_fn` instead of `is_min_const_fn` in rustdoc where appropriate This closes #76501. Specifically, it allows for nightly users with the `#![feature(const_fn)]` flag enabled to still have their `const fn` declarations documented as such, while retaining the desired behavior that rustdoc *not* document functions that have the `rustc_const_unstable` attribute as `const`.
2020-09-13Ignore rustc_private items from std docsLzu Tao-9/+10
Apply suggestions from code review Co-authored-by: Joshua Nelson <joshua@yottadb.com>
2020-09-12Fix a typoAnthony Ramine-1/+1
2020-09-12Rollup merge of #76297 - lcnr:const-ty-alias, r=varkorRalf Jung-10/+10
rustdoc: fix min_const_generics with ty::Param fixes #75913 r? @varkor cc @jyn514
2020-09-11Fix formatting for tidySlightlyOutOfPhase-1/+2
2020-09-11Check basic constness before unstable constnessSlightlyOutOfPhase-2/+3
2020-09-11Use `is_unstable_const_fn` where appropriateSlightlyOutOfPhase-5/+5
2020-09-09Remove def_id field from ParamEnvBram van den Heuvel-1/+2
2020-09-05Rollup merge of #76078 - jyn514:no-disambiguator, r=manishearthDylan DPC-10/+43
Remove disambiguators from intra doc link text Closes https://github.com/rust-lang/rust/issues/65354. r? @Manishearth The commits are mostly atomic, but there might be some mix between them here and there. I recommend reading 'refactor ItemLink' and 'refactor RenderedLink' on their own though, lots of churn without any logic changes.
2020-09-04`ty.kind` -> `ty.kind()` in rustdoc and clippyLeSeulArtichaut-10/+10
2020-09-04Misc cleanupJoshua Nelson-2/+4
- Preserve suffixes when displaying - Rename test file to match `intra-link*` - Remove unnecessary .clone()s - Improve comments and naming - Fix more bugs and add tests - Escape intra-doc link example in public documentation
2020-09-03rustdoc: fix min_const_generics with ty::ParamBastian Kauschke-10/+10
2020-09-03Remove disambiguators from link textJoshua Nelson-2/+14
Related to https://github.com/rust-lang/rust/issues/65354 - Pass through the replacement text to `markdown.rs` - Add some tests - Add a state machine that actually replaces the text when parsing Markdown
2020-09-03Refactor RenderedLink into its own typeJoshua Nelson-7/+14
2020-09-03Refactor `ItemLink` into its own structJoshua Nelson-3/+15
2020-08-31Fix strings indentGuillaume Gomez-12/+9
2020-08-29rustdoc: Fix intra-doc links for cross-crate re-exports of traitsJoshua Nelson-1/+3
#58972 ignored extern_traits because before #65983 was fixed, they would always fail to resolve, giving spurious warnings. This undoes that change, so extern traits are now seen by the `collect_intra_doc_links` pass. There are also some minor changes in librustdoc/fold.rs to avoid borrowing the extern_traits RefCell more than once at a time.
2020-08-28Rollup merge of #75330 - Nemo157:improve-doc-cfg-features, r=GuillaumeGomezPietro Albini-23/+128
Improve rendering of crate features via doc(cfg) The current rendering of crate features with `doc(cfg(feature = ".."))` is verbose and unwieldy for users, `doc(cfg(target_feature = ".."))` is special-cased to make it render nicely, and a similar rendering can be applied to `doc(cfg(feature))` to make it easier for users to read. I also added special casing of `all`/`any` cfgs consisting of just `feature`/`target-feature` to remove the repetitive "target/crate feature" prefix. The downside of this current rendering is that there is no distinction between `feature` and `target_feature` in the shorthand display. IMO this is ok, or if anything `target_feature` should have a more verbose shorthand, because `doc(cfg(feature = ".."))` usage is going to vastly outstrip `doc(cfg(target_feature = ".."))` usage in non-stdlib crates when it eventually stabilizes (or even before that given the number of crates using `cfg_attr(docsrs)` like constructs). ## Previously <img width="259" alt="Screenshot 2020-08-09 at 13 32 42" src="https://user-images.githubusercontent.com/81079/89731110-d090c000-da44-11ea-96fa-56adc6339123.png"> <img width="438" alt="image" src="https://user-images.githubusercontent.com/81079/89731116-d7b7ce00-da44-11ea-87c6-022d192d6eca.png"> <img width="765" alt="image" src="https://user-images.githubusercontent.com/81079/89731152-24030e00-da45-11ea-9552-1c270bff2729.png"> <img width="671" alt="image" src="https://user-images.githubusercontent.com/81079/89731158-28c7c200-da45-11ea-8acb-97d8a4ce00eb.png"> ## Now <img width="216" alt="image" src="https://user-images.githubusercontent.com/81079/89731123-e1d9cc80-da44-11ea-82a8-5900bd9448a5.png"> <img width="433" alt="image" src="https://user-images.githubusercontent.com/81079/89731127-e8684400-da44-11ea-9d18-572fd810f19f.png"> <img width="606" alt="image" src="https://user-images.githubusercontent.com/81079/89731162-2feed000-da45-11ea-98d2-8a88c364d903.png"> <img width="669" alt="image" src="https://user-images.githubusercontent.com/81079/89731991-ccb46c00-da4b-11ea-9416-cd20a3193826.png"> cc #43781
2020-08-24hir: consistent use and naming of lang itemsDavid Wood-7/+7
This commit adjusts the naming of various lang items so that they are consistent and don't include prefixes containing the target or "LangItem". In addition, lang item variants are no longer exported from the `lang_items` module. Signed-off-by: David Wood <david@davidtw.co>
2020-08-22rustdoc: Add support for associated items even outside the impl itselfJoshua Nelson-1/+10
Previously, associated items would only be available for linking directly on the `impl Trait for Type`. Now they can be used anywhere. - Make `item` for resolve mandatory - Refactor resolving associated items into a separate function - Remove broken trait_item logic - Don't skip the type namespace for associated items - Only call `variant_field` for `TypeNS` - Add test for associated items - Use exhaustive matches instead of wildcards Wildcards caused several bugs while implementing this.
2020-08-22rustdoc: Rename misleading functionJoshua Nelson-1/+1
- `is_associated` -> `is_type_alias` `is_associated` is not a good name for what this is doing. If you look at https://github.com/rust-lang/rust/pull/74489/files#diff-6a301d597807ee441a41e7237800563dR296, is_associated() and as_assoc_kind() do completely different things, but from the name it sounds like they're similar.
2020-08-19xpy fmtJoshua Nelson-4/+5
2020-08-19Use `impls` for intra doc links as wellJoshua Nelson-1/+1
2020-08-19Allow reusing the code in `collect_trait_impls`Joshua Nelson-53/+78
2020-08-19impl_for_type -> PrimitiveType::implsJoshua Nelson-57/+59
2020-08-19Return all impls, not just the primary oneJoshua Nelson-10/+31
2020-08-19Say `tcx.lang_items()` lessJoshua Nelson-20/+21
2020-08-19Refactor `impl_for_type` into a separate functionJoshua Nelson-29/+34
2020-08-18Add long cfg description to tooltip on short descriptionWim Looman-32/+83
2020-08-17Auto merge of #75120 - JulianKnodt:rm_reps, r=oli-obkbors-6/+6
rust_ast::ast => rustc_ast Rework of #71199 which is a rework #70621 Still working on this but just made the PR to track progress r? @Dylan-DPC
2020-08-17rust_ast::ast => rustc_astUjjwal Sharma-6/+6
2020-08-16rustdoc: clean `QPath::LangItem`David Wood-0/+21
This commit adds support for cleaning `QPath::LangItem` and `hir::GenericBound::LangItemTrait` in rustdoc. `QPath::LangItem` does not require lowering, and `hir::GenericBound::LangItemTrait` is lowered to a `GenericBound::TraitBound`. Signed-off-by: David Wood <david@davidtw.co>
2020-08-14Rollup merge of #75448 - lcnr:rn-as_local_hir_id, r=davidtwcoTyler Mandry-6/+6
merge `as_local_hir_id` with `local_def_id_to_hir_id` `as_local_hir_id` was defined as just calling `local_def_id_to_hir_id` and I think that having two different ways to call the same method is somewhat confusing. Don't really care about which of these 2 methods we want to keep. Does this require an MCP, considering that these methods are fairly frequently used?
2020-08-13merge `as_local_hir_id` with `local_def_id_to_hir_id`Bastian Kauschke-6/+6
2020-08-13Add Array Impl Lang Item in various placeskadmin-1/+1
Add basic test And also run fmt which is where the other changes are from Fix mut issues These only appear when running tests, so resolved by adding mut Swap order of forget Add pub and rm guard impl Add explicit type to guard Add safety note Change guard type from T to S It should never have been T, as it guards over [MaybeUninit<S>; N] Also add feature to test
2020-08-11Feature gate is always presentMark Rousskov-2/+2
2020-08-10Auto merge of #74936 - GuillaumeGomez:const-rustc_const_unstable, r=jyn514bors-5/+23
Don't print "const" keyword on non-nightly build if rustc_const_unstable is used on the item Fixes #74579.
2020-08-09Render longhand multiple crate/target features nicerWim Looman-2/+49
2020-08-09Improve rendering of crate features via doc(cfg)Wim Looman-0/+7