summary refs log tree commit diff
path: root/src/librustdoc/clean
AgeCommit message (Collapse)AuthorLines
2018-11-24Introduce `TyKind::Placeholder` variantscalexm-0/+1
2018-11-15Rollup merge of #55778 - nnethercote:LrcPreds, r=eddybPietro Albini-3/+3
Wrap some query results in `Lrc`. So that the frequent clones in `try_get` are cheaper.
2018-11-14Wrap some query results in `Lrc`.Nicholas Nethercote-3/+3
So that the frequent clones in `try_get` are cheaper. Fixes #54274.
2018-11-13Auto merge of #55912 - kennytm:rollup, r=kennytmbors-1/+14
Rollup of 20 pull requests Successful merges: - #55136 (Remove short doc where it starts with a codeblock) - #55711 (Format BtreeMap::range_mut example) - #55722 (impl_stable_hash_for: support enums and tuple structs with generic parameters) - #55754 (Avoid converting bytes to UTF-8 strings to print, just pass bytes to stdout/err) - #55804 (rustdoc: don't inline `pub use some_crate` unless directly asked to) - #55805 (Move `static_assert!` into librustc_data_structures) - #55837 (Make PhantomData #[structural_match]) - #55840 (Fix TLS errors when downloading stage0) - #55843 (add FromIterator<A> to Box<[A]>) - #55858 (Small fixes on code blocks in rustdoc) - #55863 (Fix a typo in std::panic) - #55870 (Fix typos.) - #55874 (string: Add documentation for `From` impls) - #55879 (save-analysis: Don't panic for macro-generated use globs) - #55882 (Reference count `crate_inherent_impls`s return value.) - #55888 (miri: for uniformity, also move memory_deallocated to AllocationExtra) - #55889 (global allocators: add a few comments) - #55896 (Document optimizations enabled by FusedIterator) - #55905 (Change `Lit::short_name` to `Lit::literal_name`.) - #55908 (Fix their/there grammar nit)
2018-11-13Use a dummy outlives requirement for `where Type:,` (see #53696)scalexm-9/+4
A `WF(Type)` predicate was used previously, which did not play well with implied bounds in chalk.
2018-11-12Use type safe `VariantIdx` instead of `usize` everywhereOliver Scherer-2/+10
2018-11-09don't inline `pub use some_crate` unless directly asked toQuietMisdreavus-1/+14
2018-11-07Rollup merge of #55734 - teresy:shorthand-fields, r=davidtwcokennytm-1/+1
refactor: use shorthand fields refactor: use shorthand for single fields everywhere (excluding tests).
2018-11-06refactor: use shorthand fieldsteresy-1/+1
2018-11-03Auto merge of #55646 - GuillaumeGomez:rollup, r=GuillaumeGomezbors-0/+8
Rollup of 5 pull requests Successful merges: - #54162 (Hide default impls items) - #55555 (Make `-Z ls` list the actual filename of external dependencies) - #55567 (add test for deriving Debug on uninhabited enum) - #55568 (test that rustdoc doesn't overflow on a big enum) - #55598 (publish-toolstate: ping maintainers when a tool builds again) Failed merges: r? @ghost
2018-11-03Rollup merge of #54162 - GuillaumeGomez:hide-default-impls-items, ↵Guillaume Gomez-0/+8
r=QuietMisdreavus Hide default impls items Follow up of #51885. Fixes #54025. cc @Mark-Simulacrum r? @QuietMisdreavus And screenshots of course: <img width="1440" alt="screen shot 2018-09-12 at 23 30 35" src="https://user-images.githubusercontent.com/3050060/45454424-1ff8d500-b6e4-11e8-9257-030322495d58.png"> <img width="1440" alt="screen shot 2018-09-12 at 23 30 42" src="https://user-images.githubusercontent.com/3050060/45454431-2424f280-b6e4-11e8-8d65-db0d85ac18f0.png">
2018-11-03Remove `ReCanonical` in favor of `ReLateBound`scalexm-1/+0
2018-11-03Move `BoundTy` to `ty::TyKind`scalexm-0/+1
2018-11-02Don't show associated const items by defaultGuillaume Gomez-1/+0
2018-10-26Rollup merge of #55358 - sinkuu:redundant_clone2, r=estebankkennytm-4/+4
Remove redundant clone (2)
2018-10-26Rollup merge of #55258 - Aaron1011:fix/rustdoc-blanket, r=GuillaumeGomezkennytm-2/+9
Fix Rustdoc ICE when checking blanket impls Fixes #55001, #54744 Previously, SelectionContext would unconditionally cache the selection result for an obligation. This worked fine for most users of SelectionContext, but it caused an issue when used by Rustdoc's blanket impl finder. The issue occured when SelectionContext chose a ParamCandidate which contained inference variables. Since inference variables can change between calls to select(), it's not safe to cache the selection result - the chosen candidate might not be applicable for future results, leading to an ICE when we try to run confirmation. This commit prevents SelectionContext from caching any ParamCandidate that contains inference variables. This should always be completely safe, as trait selection should never depend on a particular result being cached. I've also added some extra debug!() statements, which I found helpful in tracking down this bug.
2018-10-26Remove redundant cloneShotaro Yamada-4/+4
2018-10-26Fix tests and rustdocNick Cameron-0/+2
2018-10-22Fix Rustdoc ICE when checking blanket implsAaron Hill-2/+9
Fixes #55001, #54744 Previously, SelectionContext would unconditionally cache the selection result for an obligation. This worked fine for most users of SelectionContext, but it caused an issue when used by Rustdoc's blanket impl finder. The issue occured when SelectionContext chose a ParamCandidate which contained inference variables. Since inference variables can change between calls to select(), it's not safe to cache the selection result - the chosen candidate might not be applicable for future results, leading to an ICE when we try to run confirmation. This commit prevents SelectionContext from caching any ParamCandidate that contains inference variables. This should always be completely safe, as trait selection should never depend on a particular result being cached. I've also added some extra debug!() statements, which I found helpful in tracking down this bug.
2018-10-22Correct trailing ellipsis in name_from_patvarkor-1/+1
2018-10-22Fix multiple errorsGuillaume Gomez-0/+9
2018-10-19Prefer `Default::default` over `FxHash*::default` in struct constructorsOliver Scherer-11/+10
2018-10-19Deprecate the `FxHashMap()` and `FxHashSet()` constructor function hackOliver Scherer-18/+18
2018-10-13Also adjust rustdoc to the principal changesOliver Scherer-38/+35
2018-10-05Auto merge of #54741 - oli-obk:impl_trait_hierarchy, r=cramertjbors-8/+8
Nest the `impl Trait` existential item inside the return type fixes #54045 r? @cramertj
2018-10-04rename skolemized to placeholderNiko Matsakis-1/+1
2018-10-03Fix `ty::UnnormalizedProjection` in rustdocscalexm-0/+1
2018-10-02Fix rustdocOliver Schneider-8/+8
2018-10-02Attempt to resolve linking issues.David Wood-1/+1
This commit takes a different approach to add the `crate::` prefix to item paths than previous commits. Previously, recursion was stopped after a prelude crate name was pushed to the path. It is theorized that this was the cause of the linking issues since the same path logic is used for symbol names and that not recursing meant that details were being missed that affect symbol names. As of this commit, instead of ceasing recursion, a flag is passed through to any subsequent recursive calls so that the same effect can be achieved by checking that flag.
2018-10-02Add `crate::` to trait suggestions in Rust 2018.David Wood-0/+1
In the 2018 edition, when suggesting traits to import that implement a given method that is being invoked, suggestions will now include the `crate::` prefix if the suggested trait is local to the current crate.
2018-09-29Auto merge of #54660 - kennytm:rollup, r=kennytmbors-30/+74
Rollup of 8 pull requests Successful merges: - #54564 (Add 1.29.1 release notes) - #54567 (Include path in stamp hash for debuginfo tests) - #54577 (rustdoc: give proc-macros their own pages) - #54590 (std: Don't let `rust_panic` get inlined) - #54598 (Remove useless lifetimes from `Pin` `impl`s.) - #54604 (Added help message for `self_in_typedefs` feature gate) - #54635 (Improve docs for std::io::Seek) - #54645 (Compute Android gdb version in compiletest)
2018-09-29Rollup merge of #54577 - QuietMisdreavus:docs-for-procs, r=GuillaumeGomezkennytm-30/+74
rustdoc: give proc-macros their own pages related to https://github.com/rust-lang/rust/issues/49553 but i don't think it'll fix it Currently, rustdoc doesn't expose proc-macros all that well. In the source crate, only their definition function is exposed, but when re-exported, they're treated as a macro! This is an awkward situation in all accounts. This PR checks functions to see whether they have any of `#[proc_macro]`, `#[proc_macro_attribute]`, or `#[proc_macro_derive]`, and exposes them as macros instead. In addition, attributes and derives are exposed differently than other macros, getting their own item-type, CSS class, and module heading. ![image](https://user-images.githubusercontent.com/5217170/46044803-6df8da00-c0e1-11e8-8c3b-25d2c3beb55c.png) Function-like proc-macros are lumped in with `macro_rules!` macros, but they get a different declaration block (i'm open to tweaking this, it's just what i thought of given how function-proc-macros operate): ![image](https://user-images.githubusercontent.com/5217170/46044828-84069a80-c0e1-11e8-9cc4-127e5477c395.png) Proc-macro attributes and derives get their own pages, with a representative declaration block. Derive macros also show off their helper attributes: ![image](https://user-images.githubusercontent.com/5217170/46094583-ef9f4500-c17f-11e8-8f71-fa0a7895c9f6.png) ![image](https://user-images.githubusercontent.com/5217170/46101529-cab3cd80-c191-11e8-857a-946897750da1.png) There's one wrinkle which this PR doesn't address, which is why i didn't mark this as fixing the linked issue. Currently, proc-macros don't expose their attributes or source span across crates, so while rustdoc knows they exist, that's about all the information it gets. This leads to an "inlined" macro that has absolutely no docs on it, and no `[src]` link to show you where it was declared. The way i got around it was to keep proc-macro re-export disabled, since we do get enough information across crates to properly link to the source page: ![image](https://user-images.githubusercontent.com/5217170/46045074-2cb4fa00-c0e2-11e8-81bc-33a8205fbd03.png) Until we can get a proc-macro's docs (and ideally also its source span) across crates, i believe this is the best way forward.
2018-09-28rustc: keep a Span for each predicate in ty::GenericPredicates.Eduard-Mihai Burtescu-2/+4
2018-09-26add derive macros' helper attributes to doc outputQuietMisdreavus-1/+9
2018-09-26Auto merge of #54199 - nikomatsakis:predicate_may_hold-failure, r=eddybbors-5/+14
overlook overflows in rustdoc trait solving Context: The new rustdoc "auto trait" feature walks across impls and tries to run trait solving on them with a lot of unconstrained variables. This is prone to overflows. These overflows used to cause an ICE because of a caching bug (fixed in this PR). But even once that is fixed, it means that rustdoc causes an overflow rather than generating docs. This PR therefore adds a new helper that propagates the overflow error out. This requires rustdoc to then decide what to do when it encounters such an overflow: technically, an overflow represents neither "yes" nor "no", but rather a failure to make a decision. I've decided to opt on the side of treating this as "yes, implemented", since rustdoc already takes an optimistic view. This may prove to include too many items, but I *suspect* not. We could probably reduce the rate of overflows by unifying more of the parameters from the impl -- right now we only seem to consider the self type. Moreover, in the future, as we transition to Chalk, overflow errors are expected to just "go away" (in some cases, though, queries might return an ambiguous result). Fixes #52873 cc @QuietMisdreavus -- this is the stuff we were talking about earlier cc @GuillaumeGomez -- this supersedes #53687
2018-09-25disable proc-macro re-export inliningQuietMisdreavus-7/+8
Proc-macros don't emit their attributes or source spans across crates. This means that rustdoc can't actually see the docs of a proc-macro if it wasn't defined in the active crate, and attempting to inline it creates an empty page with no docs or source link. In lieu of attempting to fix that immediately, this commit forces proc-macro re-exports to never inline, which at least creates usable links to complete documentation.
2018-09-25handle proc-macros as macros instead of functionsQuietMisdreavus-32/+67
2018-09-20shuffle ownership of `external_traits`QuietMisdreavus-6/+14
constraints: - clean/inline.rs needs this map to fill in traits when inlining - fold.rs needs this map to allow passes to fold trait items - html/render.rs needs this map to seed the Cache.traits map of all known traits The first two are the real problem, since `DocFolder` only operates on `clean::Crate` but `clean/inline.rs` only sees the `DocContext`. The introduction of early passes means that these two now exist at the same time, so they need to share ownership of the map. Even better, the use of `Crate` in a rustc thread pool means that it needs to be Sync, so it can't use `Lrc<Lock>` to manually activate thread-safety. `parking_lot` is reused from elsewhere in the tree to allow use of its `ReentrantMutex`, as the relevant parts of rustdoc are still single-threaded and this allows for easier use in that context.
2018-09-20refactor: move `access_levels` into RenderInfoQuietMisdreavus-7/+4
2018-09-20collect auto-/blanket-impls during collect-trait-implsQuietMisdreavus-62/+26
2018-09-20don't check visibility when inlining local implsQuietMisdreavus-6/+10
those get handled properly in strip-hidden anyway
2018-09-20pull impl generics from HIR if availableQuietMisdreavus-13/+19
2018-09-20collect impl items from the HIR if availableQuietMisdreavus-6/+17
2018-09-20pull local types from the HIR instead of tcxQuietMisdreavus-1/+10
2018-09-20handle local names when registering FQNsQuietMisdreavus-4/+8
2018-09-20add a bunch of debug printsQuietMisdreavus-0/+1
2018-09-20undo some tweaks to build_implQuietMisdreavus-13/+8
2018-09-20don't record an external trait if it's not externalQuietMisdreavus-0/+4
2018-09-20only move access_levels/external_traits after early passesQuietMisdreavus-5/+2
2018-09-20print local inlined consts via the HIR mapQuietMisdreavus-1/+5