summary refs log tree commit diff
path: root/src/librustdoc/clean/inline.rs
AgeCommit message (Collapse)AuthorLines
2018-06-03rustdoc: hide macro export statements from docsQuietMisdreavus-0/+3
2018-05-07Prevent infinite recursion of modulesGuillaume Gomez-8/+8
2018-04-21Add some f32 and f64 inherent methods in libcoreSimon Sapin-0/+2
… previously in the unstable core::num::Float trait. Per https://github.com/rust-lang/rust/issues/32110#issuecomment-379503183, the `abs`, `signum`, and `powi` methods are *not* included for now since they rely on LLVM intrinsics and we haven’t determined yet whether those instrinsics lower to calls to libm functions on any platform.
2018-04-21Replace StrExt with inherent str methods in libcoreSimon Sapin-0/+1
2018-04-21Replace SliceExt with inherent [T] methods in libcoreSimon Sapin-0/+1
2018-04-21Move non-allocating [u8] inherent methods to libcoreSimon Sapin-0/+1
Fixes #45803
2018-04-19Remove HIR inliningWesley Wiser-23/+1
Fixes #49690
2018-03-02Replace Rc with Lrc for shared dataJohn Kåre Alsaker-2/+2
2018-02-24Rollup merge of #48415 - QuietMisdreavus:traits-on-traits-on-traits, ↵Manish Goregaokar-3/+12
r=Manishearth rustdoc: don't crash when an external trait's docs needs to import another trait Fixes https://github.com/rust-lang/rust/issues/48414 When resolving intra-paths for an item, rustdoc needs to have information about their items on hand, for proper bookkeeping. When loading a path for an external item, it needs to load these items from their host crate, since their information isn't otherwise available. This includes resolving paths for those docs. which can cause this process to recurse. Rustdoc keeps a map of external traits in a `RefCell<HashMap<DefId, Trait>>`, and it keeps a borrow of this active when importing an external trait. In the linked crash, this led to a RefCell borrow error, panic, and ICE. This PR manually releases the borrow while importing the trait, and also keeps a list of traits being imported at the given moment. The latter keeps rustdoc from infinitely recursing as it tries to import the same trait repeatedly.
2018-02-21proper early-bail conditionQuietMisdreavus-1/+1
2018-02-21track extern traits being inlinedQuietMisdreavus-1/+6
2018-02-21manually release `cx.external_traits` while building the new traitQuietMisdreavus-3/+7
2018-02-18Don't generate auto trait impls for type aliasesAaron Hill-1/+1
2018-02-18Cleanup formattingAaron Hill-3/+1
2018-02-18Generate documentation for auto-trait implsAaron Hill-11/+31
A new section is added to both both struct and trait doc pages. On struct/enum pages, a new 'Auto Trait Implementations' section displays any synthetic implementations for auto traits. Currently, this is only done for Send and Sync. On trait pages, a new 'Auto Implementors' section displays all types which automatically implement the trait. Effectively, this is a list of all public types in the standard library. Synthesized impls for a particular auto trait ('synthetic impls') take into account generic bounds. For example, a type 'struct Foo<T>(T)' will have 'impl<T> Send for Foo<T> where T: Send' generated for it. Manual implementations of auto traits are also taken into account. If we have the following types: 'struct Foo<T>(T)' 'struct Wrapper<T>(Foo<T>)' 'unsafe impl<T> Send for Wrapper<T>' // pretend that Wrapper<T> makes this sound somehow Then Wrapper will have the following impl generated: 'impl<T> Send for Wrapper<T>' reflecting the fact that 'T: Send' need not hold for 'Wrapper<T>: Send' to hold Lifetimes, HRTBS, and projections (e.g. '<T as Iterator>::Item') are taken into account by synthetic impls However, if a type can *never* implement a particular auto trait (e.g. 'struct MyStruct<T>(*const T)'), then a negative impl will be generated (in this case, 'impl<T> !Send for MyStruct<T>') All of this means that a user should be able to copy-paste a synthetic impl into their code, without any observable changes in behavior (assuming the rest of the program remains unchanged).
2018-01-23Auto merge of #47678 - kennytm:rollup, r=kennytmbors-0/+2
Rollup of 14 pull requests - Successful merges: #47423, #47425, #47440, #47541, #47549, #47554, #47558, #47610, #47635, #47655, #47661, #47662, #47667, #47672 - Failed merges:
2018-01-23rustdoc: Show when traits are auto traitsOliver Middleton-0/+2
2018-01-22Resolve foreign macrosManish Goregaokar-1/+5
2018-01-17Rollup merge of #47313 - ollie27:rustdoc_record_extern_trait, r=QuietMisdreavusGuillaume Gomez-0/+9
rustdoc: Populate external_traits with traits only seen in impls This means default methods can always be found and "Important traits" will include all spotlight traits.
2018-01-15Reexport -> re-export in prose and documentation commentsCarol (Nichols || Goulding)-3/+3
2018-01-13Remove `impl Foo for ..` in favor of `auto trait Foo`leonardo.yvens-21/+0
No longer parse it. Remove AutoTrait variant from AST and HIR. Remove backwards compatibility lint. Remove coherence checks, they make no sense for the new syntax. Remove from rustdoc.
2018-01-10rustdoc: Populate external_traits with traits only seen in implsOliver Middleton-0/+9
This means default methods can always be found and "Important traits" will include all spotlight traits.
2018-01-08rustc::ty: Rename `struct_variant` to `non_enum_variant`Robin Kruppe-2/+2
It is also intended for use with unions.
2017-12-18Fix ?Sized where bound not being displayed at the correct placeGuillaume Gomez-2/+1
2017-12-13Auto merge of #46419 - jseyfried:all_imports_in_metadata, r=nrcbors-1/+1
Record all imports (`use`, `extern crate`) in the crate metadata This PR adds non-`pub` `use` and `extern crate` imports in the crate metadata since hygienic macros invoked in other crates may use them. We already include all other non-`pub` items in the crate metadata. This improves import suggestions in some cases. Fixes #42337. r? @nrc
2017-12-09rustdoc: Include `impl [u8]` in the docsOliver Middleton-0/+1
2017-12-05Add field `is_import` to `def::Export`.Jeffrey Seyfried-1/+1
2017-11-29rustdoc: Fix issues with cross-crate inlined associated itemsOliver Middleton-68/+4
* Visibility was missing from impl items. * Attributes and docs were missing from consts and types in impls. * Const default values were missing from traits. This unifies the code that handles associated items from impls and traits.
2017-11-21Auto merge of #45039 - QuietMisdreavus:doc-spotlight, ↵bors-0/+2
r=GuillaumeGomez,QuietMisdreavus show in docs whether the return type of a function impls Iterator/Read/Write Closes #25928 This PR makes it so that when rustdoc documents a function, it checks the return type to see whether it implements a handful of specific traits. If so, it will print the impl and any associated types. Rather than doing this via a whitelist within rustdoc, i chose to do this by a new `#[doc]` attribute parameter, so things like `Future` could tap into this if desired. ### Known shortcomings ~~The printing of impls currently uses the `where` class over the whole thing to shrink the font size relative to the function definition itself. Naturally, when the impl has a where clause of its own, it gets shrunken even further:~~ (This is no longer a problem because the design changed and rendered this concern moot.) The lookup currently just looks at the top-level type, not looking inside things like Result or Option, which renders the spotlights on Read/Write a little less useful: <details><summary>`File::{open, create}` don't have spotlight info (pic of old design)</summary> ![image](https://user-images.githubusercontent.com/5217170/31209495-e59d027e-a950-11e7-9998-ceefceb71c07.png) </details> All three of the initially spotlighted traits are generically implemented on `&mut` references. Rustdoc currently treats a `&mut T` reference-to-a-generic as an impl on the reference primitive itself. `&mut Self` counts as a generic in the eyes of rustdoc. All this combines to create this lovely scene on `Iterator::by_ref`: <details><summary>`Iterator::by_ref` spotlights Iterator, Read, and Write (pic of old design)</summary> ![image](https://user-images.githubusercontent.com/5217170/31209554-50b271ca-a951-11e7-928b-4f83416c8681.png) </details>
2017-11-17spotlight Iterator/Read/Write impls on function return typesQuietMisdreavus-0/+2
2017-11-15Support `extern type` in rustdoc.kennytm-0/+5
Fixes #45640.
2017-11-03[Syntax Breaking] Rename DefaultImpl to AutoImplleonardo.yvens-3/+3
DefaultImpl is a highly confusing name for what we now call auto impls, as in `impl Send for ..`. The name auto impl is not formally decided but for sanity anything is better than `DefaultImpl` which refers neither to `default impl` nor to `impl Default`.
2017-09-18incr.comp.: Already hash HIR bodies during metadata export so they don't ↵Michael Woerister-2/+2
have to be hashed in downstream crates.
2017-09-14rustdoc: pretty-print Unevaluated expressions in types.Eduard-Mihai Burtescu-1/+1
2017-09-07rustc: Remove `CrateStore::crates` as a methodAlex Crichton-1/+1
This commit moves the `crates` method to a query and then migrates all callers to use a query instead of the now-renamed `crates_untracked` method where possible. Closes #41417
2017-09-05rustc: Rename item_body query to extern_const_bodyAlex Crichton-1/+1
Should hopefully more accurately reflect what's happening! This commit also removes the cache in the cstore implementation as it's already cached through the query infrastructure.
2017-09-05rustc: Migrate `CrateStore::item_body` to a queryAlex Crichton-1/+1
This commit migrates the `item_body` method on `CrateStore` to a query instead to enable better tracking of dependencies and whatnot.
2017-09-05rustc: Remove lang item methods from CrateStoreAlex Crichton-20/+21
Given the previous commit, these are now trivially representable as queries!
2017-09-05rustc: Flag some CrateStore methods as "untracked"Alex Crichton-3/+3
The main use of `CrateStore` *before* the `TyCtxt` is created is during resolution, but we want to be sure that any methods used before resolution are not used after the `TyCtxt` is created. This commit starts moving the methods used by resolve to all be named `{name}_untracked` where the rest of the compiler uses just `{name}` as a query. During this transition a number of new queries were added to account for post-resolve usage of these methods.
2017-09-05rustc: Move implementations_of_trait to a queryAlex Crichton-2/+4
While we're at it, make it two separate queries so one's for rustdoc and one's for the compiler, hopefully being a bit more targeted.
2017-08-15use field init shorthand EVERYWHEREZack M. Davis-13/+13
Like #43008 (f668999), but _much more aggressive_.
2017-08-11Fix some typosBastien Orivel-1/+1
2017-06-27rustc: move the PolyFnSig out of TyFnDef.Eduard-Mihai Burtescu-1/+1
2017-06-13On-demand is_const_fnTaylor Cramer-2/+2
2017-06-13Auto merge of #42608 - ollie27:rustdoc_variant_reexport, r=QuietMisdreavusbors-4/+4
rustdoc: Fix missing enum variant reexports Fixes #35488
2017-06-12rustdoc: Fix missing enum variant reexportsOliver Middleton-4/+4
2017-06-07Fix translation of external spans.Inokentiy Babushkin-1/+1
2017-05-28fix RUST_LOG ICE caused by printing a default impl's DefIdAriel Ben-Yehuda-1/+1
2017-05-25Fix merge conflicts.Jeffrey Seyfried-1/+1
2017-05-22rustdoc: Fix names of items in cross crate reexported modulesOliver Middleton-22/+6
For renamed reexports the new name should be used.