Commit Graph

2624 Commits

Author SHA1 Message Date
Oliver Middleton
0b2746c8db rustdoc: Improve playground run buttons
The main change is to stop using javascript to generate the URLs and use
rustdoc instead.

This also adds run buttons to the error index examples.
2016-10-15 18:32:03 +01:00
QuietMisdreavus
07b27bb34c rustdoc: break where clauses onto their own line if they don't have enough room 2016-10-15 10:29:47 -05:00
QuietMisdreavus
42f28d31bf rustdoc: apply proper indent when where clauses aren't on their own line 2016-10-15 09:58:04 -05:00
Jonathan Turner
3da9ddb7bf Rollup merge of #37102 - est31:rustdoc_question_mark, r=GuillaumeGomez
rustdoc: color the question mark operator

The idea of coloring `?` specially was proposed by @eddyb in: https://github.com/rust-lang/rust/issues/31436#issuecomment-247426582
2016-10-14 12:07:07 -07:00
QuietMisdreavus
c6ab68528a fix spurious </span> appearing before the opening tag 2016-10-13 13:58:04 -05:00
QuietMisdreavus
4a6921e10e rustdoc: add line breaks to where clauses a la rustfmt 2016-10-13 10:17:25 -05:00
Alex Crichton
5ac7f4fc31 Rollup merge of #37050 - frewsxcv:librustdoc, r=alexcrichton
librustdoc refactoring and cleanup.
2016-10-12 14:07:55 -07:00
Alex Crichton
9d70ff384f Rollup merge of #36995 - nrc:stable, r=@nikomatsakis
stabilise ?, attributes on stmts, deprecate Reflect

r? @nikomatsakis
2016-10-12 14:07:55 -07:00
est31
87cbfb455f Change color and make ? bold 2016-10-12 22:45:41 +02:00
est31
6a89b8fd0a rustdoc: color the question mark operator
The idea was proposed by eddyb in: https://github.com/rust-lang/rust/issues/31436#issuecomment-247426582
2016-10-12 05:39:57 +02:00
Nick Cameron
9bc6d26092 Stabilise ?
cc [`?` tracking issue](https://github.com/rust-lang/rust/issues/31436)
2016-10-12 08:40:22 +13:00
Guillaume Gomez
6717dba276 Rollup merge of #36679 - QuietMisdreavus:rustdoc-line-breaks, r=steveklabnik
rustdoc: print non-self arguments of bare functions and struct methods on their own line

This change alters the formatting rustdoc uses when it creates function and struct method documentation. For bare functions, each argument is printed on its own line. For struct methods, non-self arguments are printed on their own line. In both cases, no line breaks are introduced if there are no arguments, and for struct methods, no line breaks are introduced if there is only a single self argument. This should aid readability of long function signatures and allow for greater comprehension of these functions.

I've run rustdoc with these changes on my crate egg-mode and its set of dependencies and put the result [on my server](https://shiva.icesoldier.me/doc-custom/egg_mode/). Of note, here are a few shortcut links that highlight the changes:

* [Bare function with a long signature](https://shiva.icesoldier.me/doc-custom/egg_mode/place/fn.reverse_geocode.html)
* [Struct methods, with single self argument and with self and non-self arguments](https://shiva.icesoldier.me/doc-custom/egg_mode/tweet/struct.Timeline.html#method.reset)
* [Bare functions with no arguments](https://shiva.icesoldier.me/doc-custom/rand/fn.thread_rng.html) and [struct methods with no arguments](https://shiva.icesoldier.me/doc-custom/hyper/client/struct.Client.html#method.new) are left unchanged.

This PR consists of two commits: one for bare functions and one for struct methods.
2016-10-11 17:51:25 +02:00
Corey Farwell
e4f066fe8b Remove unnecessary pub function classifier. 2016-10-09 00:17:50 -04:00
Corey Farwell
ba20da1db7 Make ExternalHtml::load short-circuited. 2016-10-09 00:17:49 -04:00
Corey Farwell
7be14eea94 Refactor away load_or_return macro. 2016-10-09 00:17:46 -04:00
Corey Farwell
f410da5cbe Add doc comments describing fields on externalfiles::ExternalHtml. 2016-10-08 22:55:51 -04:00
bors
b98cc352cb Auto merge of #36637 - GuillaumeGomez:fix_run_button, r=bluss
Fixes run button appearing when it shouldn't

Fixes #36621.

r? @steveklabnik
2016-10-08 19:42:55 -07:00
Corey Farwell
fd073cf4a3 Don't construct PathBuf ownership if we don't need it. 2016-10-08 21:33:28 -04:00
bors
6e8f92f11c Auto merge of #36981 - alexcrichton:catch-unwind-for-tests, r=sfackler
std: Minor cleanup to libtest

* Don't spawn two threads for all tests, just one now that `catch_unwind` is
  stable.
* Remove usage of the unstable `box` keyword
* Remove usage of the unstable `FnBox` trait
2016-10-07 11:38:27 -07:00
Guillaume Gomez
b40285102b Rollup merge of #37003 - GuillaumeGomez:underline-removal, r=steveklabnik
Remove underline when run button hovered

r? @steveklabnik
2016-10-07 11:45:04 +02:00
Guillaume Gomez
4b402dbe69 Remove underline when run button hovered 2016-10-06 18:10:00 +02:00
Alex Crichton
0714024c99 std: Minor cleanup to libtest
* Don't spawn two threads for all tests, just one now that `catch_unwind` is
  stable.
* Remove usage of the unstable `box` keyword
* Remove usage of the unstable `FnBox` trait
2016-10-06 09:02:33 -07:00
Jonathan Turner
4c100260e0 Rollup merge of #36966 - ollie27:rustdoc_mut_ptr_impl, r=alexcrichton
rustdoc: Fix missing *mut T impl

`impl<T> *mut T` is currently missing from
https://doc.rust-lang.org/nightly/std/primitive.pointer.html and this adds
it back.
2016-10-06 08:35:43 -07:00
Guillaume Gomez
8983d1e67a Fixes run button appearing when it shouldn't 2016-10-05 21:14:55 +02:00
Vadim Petrochenkov
bc0eabd7a7 Remove some unused methods from metadata
Address comments + Fix rebase
2016-10-04 23:53:51 +03:00
Vadim Petrochenkov
bd291ce21a Turn some impossible definitions into ICEs 2016-10-04 22:25:25 +03:00
Vadim Petrochenkov
75d6522b9a Eliminate ty::VariantKind in favor of def::CtorKind 2016-10-04 22:22:36 +03:00
Vadim Petrochenkov
d19c16acfb Fix cross-crate resolution of half-items created by export shadowing 2016-10-04 22:20:37 +03:00
Oliver Middleton
cd7a04cadc rustdoc: Fix missing *mut T impl
`impl<T> *mut T` is currently missing from
https://doc.rust-lang.org/nightly/std/primitive.pointer.html and this adds
it back.
2016-10-04 18:39:28 +01:00
Manish Goregaokar
825e6b3287 Rollup merge of #36903 - frewsxcv:typekind, r=jseyfried
Minor librustdoc cleanup and refactoring.
2016-10-04 15:24:02 +05:30
bors
ff713464e6 Auto merge of #36847 - alexcrichton:rustc-macro-doc, r=nrc
rustdoc: Fix documenting rustc-macro crates

This commit adds a "hack" to the session to track whether we're a rustdoc
session or not. If we're rustdoc then we skip the expansion to add the
rustc-macro infrastructure.

Closes #36820
2016-10-03 07:40:22 -07:00
Corey Farwell
35d214afe6 Remove redundant 'Variant' in variant names, stop reexporting. 2016-10-02 21:58:23 -04:00
Corey Farwell
88d41441f6 Migrate VariantKind constructor to Clean impl.
https://github.com/rust-lang/rust/pull/36903#discussion_r81477884
2016-10-02 21:58:22 -04:00
Corey Farwell
b55468c8fe Simplify equality checks. 2016-10-02 21:58:22 -04:00
Corey Farwell
5b9ba4c550 Remove redundant 'Import' in variant names, stop reexporting. 2016-10-02 21:58:21 -04:00
Corey Farwell
a400cccd54 Cleanup return statements. 2016-10-02 21:58:20 -04:00
Corey Farwell
6d0894940f Migrate VariantKind construction function to associated function. 2016-10-02 21:58:20 -04:00
Corey Farwell
0d0f1b4690 Rename method 'to_string' to match conventions. 2016-10-02 21:58:19 -04:00
Corey Farwell
c3bc905e5f Remove redundant 'Type' in variant names, stop reexporting. 2016-10-02 21:58:18 -04:00
bors
ab38d52df7 Auto merge of #36885 - Manishearth:rollup, r=Manishearth
Rollup of 6 pull requests

- Successful merges: #36865, #36872, #36873, #36877, #36880, #36882
- Failed merges:
2016-10-01 10:17:20 -07:00
Manish Goregaokar
259d1fcd47 Rollup merge of #36599 - jonas-schievink:whats-a-pirates-favorite-data-structure, r=pnkfelix
Contains a syntax-[breaking-change] as a separate commit (cc #31645).nnAlso renames slice patterns from `PatKind::Vec` to `PatKind::Slice`.
2016-10-01 19:22:12 +05:30
Manish Goregaokar
2e5837a102 Rollup merge of #36872 - frewsxcv:rustdoc, r=GuillaumeGomez
A couple refactorings in librustdoc.

None
2016-10-01 16:38:32 +05:30
Brian Anderson
a4c3288129 Change the sigs of set_print/set_panic to allow restoring the default objects 2016-09-30 14:02:53 -07:00
Corey Farwell
7732e621f4 Simplify logic around Context's root_path.
Was previously cached and maintained in the `Context`, which to me seems
overkill.
2016-09-30 15:54:53 -04:00
Corey Farwell
c66c4533d1 Migrate Item ➡ ItemType function to method. 2016-09-30 15:54:53 -04:00
Alex Crichton
7724a04b0f rustdoc: Fix documenting rustc-macro crates
This commit adds a "hack" to the session to track whether we're a rustdoc
session or not. If we're rustdoc then we skip the expansion to add the
rustc-macro infrastructure.

Closes #36820
2016-09-30 10:49:30 -07:00
Jonas Schievink
cf0b7bdd0c Call arrays "arrays" instead of "vecs" internally 2016-09-28 22:30:30 +02:00
bors
ec7679b460 Auto merge of #36764 - jonathandturner:rollup, r=jonathandturner
Rollup of 14 pull requests

- Successful merges: #36563, #36574, #36586, #36662, #36663, #36669, #36676, #36721, #36723, #36727, #36729, #36742, #36754, #36756
- Failed merges:
2016-09-26 23:30:19 -07:00
QuietMisdreavus
2a7d495e65 rustdoc: fix regression when printing single-element tuples 2016-09-26 19:36:48 -05:00
Jonathan Turner
ee2e115995 Rollup merge of #36729 - frewsxcv:rustdoc, r=alexcrichton
librustdoc refactoring and cleanup.

See each commit for more information. Biggest changes here is the addition of a `passes` module and each pass now lives in its own submodule.
2016-09-26 17:29:49 -07:00
Jonathan Turner
d6a7a4fb57 Rollup merge of #36676 - bluss:rustdoc-where-css, r=steveklabnik
rustdoc css: Put `where` in trait listings on a new line

This is about the gray area at the top of a trait's documentation page,
that lists all methods and their signatures. A big trait page like
Iterator is very crowded without this tweak.
2016-09-26 17:29:48 -07:00
Jonathan Turner
3775be853e Rollup merge of #36586 - japaric:rustdoc-sysroot, r=alexcrichton
rustdoc: implement --sysroot

with the same semantics as rustc. This let us build documentation for a
crate that depends on a custom sysroot.

r? @alexcrichton
cc @cbiffle
2016-09-26 17:29:47 -07:00
QuietMisdreavus
fb442a7e27 rustdoc: format bare functions like rustfmt
see commit 2a274e72 for details
2016-09-26 18:47:09 -05:00
QuietMisdreavus
2a274e720f rustdoc: format struct methods like rustfmt
* ignore signatures 80 characters or shorter
* otherwise, put arguments and return arrow on their own line, indented
  to the opening parenthesis

in doing this, most of a plain-text output has been written for rustdoc,
accessible through "alternate" Display printing: "{:#}"
2016-09-26 16:02:21 -05:00
Tim Neumann
ad81f11b01 deduplicate inline is_nightly_build implementations 2016-09-26 07:07:41 +02:00
Tim Neumann
3f287efc82 refactor away get_unstable_features_setting 2016-09-26 07:07:41 +02:00
Corey Farwell
99e1b9cfa6 Move in-pass-function structs and impls outside functions.
Now that each pass has its own module, there's not much of a reason to
keep these structs within the functions.
2016-09-25 18:05:58 -04:00
Corey Farwell
bd62c4c83d Move pass contants/types into the new pass module. 2016-09-25 17:59:40 -04:00
Corey Farwell
f1a3eb633d Separate rustdoc passes into separate modules. 2016-09-25 17:40:16 -04:00
Corey Farwell
5495fab363 Privatize unindent function.
Doesn't look like it's used anywhere outside the module.
2016-09-25 15:04:01 -04:00
Corey Farwell
a147a9d01b Fix incorrect alignment for if statement. 2016-09-25 13:57:12 -04:00
Corey Farwell
ae3ed31155 Use underscores to breakup long number. 2016-09-25 13:56:54 -04:00
Guillaume Gomez
d56b116e63 Rollup merge of #36559 - grimreaper:eax/fix/r1, r=nikomatsakis
Fix a variety of minor issues

CSS:
- use integer values for font-size in CSS
- use correct ordering of @import
- "invisible" isn't a tag - presume its a class
- "border-color" defines the complete border

python:
- use "not" instead of == "[]" for python
- prefer triple quoted docstrings
- prefer static functions where possible
- prefer modern style classes where possible
- remove semicolons;

global:
- remove duplicated words words
2016-09-24 00:15:45 +02:00
Ulrik Sverdrup
e82d13ea4b rustdoc css: Put where in trait listings on a new line
This is about the gray area at the top of a trait's documentation page,
that lists all methods and their signatures. A big trait page like
Iterator is very crowded without this tweak.
2016-09-23 20:31:14 +02:00
QuietMisdreavus
fccfc5392a rustdoc: format non-self arguments for struct methods on their own line 2016-09-23 13:17:07 -05:00
QuietMisdreavus
9cfd4ef38f rustdoc: print arguments to bare functions on their own line 2016-09-23 13:16:49 -05:00
Eduard Burtescu
a96abca2a4 rustc_metadata: replace RBML with a simple and type-safe scheme. 2016-09-20 20:08:05 +03:00
Eduard Burtescu
24aef24e1a rustc_metadata: split the Def description of a DefId from item_children. 2016-09-20 20:08:05 +03:00
Eduard Burtescu
adddfccf2b rustc_metadata: move all encoding/decoding helpers to methods. 2016-09-20 20:08:05 +03:00
Eduard Burtescu
ef4352fba6 rustc_metadata: group information into less tags. 2016-09-20 20:08:04 +03:00
Eduard Burtescu
89736e8671 rustc: remove ImplOrTraitItemId and TraitDef's associated_type_names. 2016-09-20 20:08:03 +03:00
Eduard Burtescu
8734aaa33e rustc_metadata: move more RBML tags to auto-serialization. 2016-09-20 20:08:02 +03:00
Eduard Burtescu
02c4155d2c rustc: remove hir::fold. 2016-09-20 20:08:00 +03:00
Eduard Burtescu
903ec52ba9 rustc: replace uses of NodeId in Def, other than closures and labels. 2016-09-20 20:08:00 +03:00
Eduard Burtescu
fc363cb482 rustc_metadata: go only through rustc_serialize in astencode. 2016-09-20 20:07:54 +03:00
Jorge Aparicio
e0c60b4d02 rustdoc: implement --sysroot
with the same semantics as rustc. This let us build documentation for a
crate that depends on a custom sysroot.
2016-09-19 15:56:38 -05:00
Eitan Adler
4f11a39e26 invisible isn't a tag 2016-09-17 23:30:42 -07:00
Eitan Adler
ccb78d20cd border-color > border 2016-09-17 23:30:22 -07:00
Eitan Adler
101d987d29 add missing semi-colon 2016-09-17 23:29:00 -07:00
Eitan Adler
73d2653417 duplicate the 2016-09-17 23:19:03 -07:00
Eitan Adler
f7811c1ca6 Fix order of @import
In CSS 2.1, any @import rules must precede all other rules (except the
@charset rule, if present).
2016-09-17 22:56:22 -07:00
bors
1265cbf4e0 Auto merge of #36393 - petrochenkov:ancient, r=eddyb
Remove some obsolete code from the compiler
2016-09-15 13:34:11 -07:00
bors
6ffdda1ba1 Auto merge of #36293 - liigo:docblock-short, r=steveklabnik
rustdoc: don't collapse `docblock-short`

![docblock-short](https://cloud.githubusercontent.com/assets/346530/18267298/137d2542-7451-11e6-9c8e-dd4e1f1fea29.png)
2016-09-14 15:39:23 -07:00
bors
5a5736db91 Auto merge of #36472 - GuillaumeGomez:rollup, r=GuillaumeGomez
Rollup of 5 pull requests

- Successful merges: #36334, #36335, #36363, #36374, #36467
- Failed merges:
2016-09-14 08:28:05 -07:00
Guillaume Gomez
d939cbeefe Rollup merge of #36334 - GuillaumeGomez:run_but, r=steveklabnik
Set run button transparent instead of invisible

r? @steveklabnik

And of course a screenshot:

![screenshot from 2016-09-08 01-15-45](https://cloud.githubusercontent.com/assets/3050060/18331849/31fe1f8c-7562-11e6-9ae9-1dab44089ec6.png)
2016-09-14 17:15:36 +02:00
bors
97b561a094 Auto merge of #35667 - ollie27:rustdoc_opaque_structs, r=steveklabnik
rustdoc: Don't add extra newlines for fully opaque structs

Changes the definition for braced structs with only private or hidden fields to save space on the page.

Before:
```
pub struct Vec<T> {
    // some fields omitted
}
```
After:
```
pub struct Vec<T> { /* fields omitted */ }
```

This also cleans up empty braced structs.

Before:
```
pub struct Foo {
}
```
After:
```
pub struct Foo {}
```

[before](https://doc.rust-lang.org/nightly/std/vec/struct.Vec.html) [after](https://ollie27.github.io/rust_doc_test/std/vec/struct.Vec.html)

cc #34713
2016-09-14 04:57:47 -07:00
Vadim Petrochenkov
4b6c4c08df Remove some ancient code providing special support for newtypes 2016-09-13 23:33:50 +03:00
Guillaume Gomez
26315bf015 Rollup merge of #36045 - ollie27:rustdoc_titles3, r=steveklabnik
rustdoc: Add missing item types to page titles

Most pages include the item type in the title such as "Struct std::vec::Vec". However it is missing from the pages for foreign functions, type definitions, macros, statics and constants. This adds them so for example, instead of a title of "std::u32::MAX" it is "Constant std::u32::MAX" to match the others.

[before](https://doc.rust-lang.org/nightly/std/u32/constant.MAX.html) [after](https://ollie27.github.io/rust_doc_test/std/u32/constant.MAX.html)
[before](https://doc.rust-lang.org/nightly/std/io/type.Result.html) [after](https://ollie27.github.io/rust_doc_test/std/io/type.Result.html)

Previous discussions: #34345, #35003
2016-09-10 15:57:50 +02:00
Liigo
26d5f99ec0 rustdoc: more docblock-short styles 2016-09-09 12:28:53 +08:00
Liigo
93cdce4cf3 rustdoc: don't collapse docblock-short 2016-09-09 12:28:37 +08:00
Oliver Middleton
8154a6bc69 rustdoc: Don't add extra newlines for fully opaque structs
Changes the definition for opaque structs to look like `pub struct Vec<T>
{ /* fields omitted */ }` to save space on the page.

Also only use one line for empty braced structs.
2016-09-09 01:41:42 +01:00
Vadim Petrochenkov
f2b672d556 Refactor TyStruct/TyEnum/TyUnion into TyAdt 2016-09-08 22:17:53 +03:00
Guillaume Gomez
a2faf5477c Set run button transparent instead of invisible 2016-09-08 01:16:06 +02:00
bors
9627e9ef6e Auto merge of #36266 - Sawyer47:issue-35169, r=alexcrichton
rustdoc: Filter more incorrect methods inherited through Deref

Old code filtered out only static methods. This code also excludes &mut self methods if there is no DerefMut implementation.

Fixes #35169
2016-09-07 12:30:03 -07:00
bors
1d04201565 Auto merge of #36078 - ollie27:rustdoc_search_assocconst, r=alexcrichton
rustdoc: Fix associated consts in search results

Associated consts can appear in none trait impls so need to be treated
like methods when generating the search index.

Fixes #36031
2016-09-05 22:32:36 -07:00
Piotr Jawniak
915bbdac58 rustdoc: Filter more incorrect methods inherited through Deref
Old code filtered out only static methods. This code also excludes
&mut self methods if there is no DerefMut implementation
2016-09-05 20:24:55 +02:00
bors
86995dc8c5 Auto merge of #36240 - leeopop:master, r=jseyfried
Allow CompilerControllers to access rustc_plugin::registry::Registry

fixes #36064

I chose to put ructc_plugin::registry::Registry structure
into CompilerState structure, instead of Session structure.
This will preserve dependencies among librustc, libructc_driver, and libructc_plugin.

@jseyfried @sanxiyn
2016-09-04 18:36:42 -07:00
Vadim Petrochenkov
e05e74ac83 Replace _, _ with .. 2016-09-04 12:30:33 +03:00
Keunhong Lee
ca5dfd0c97 Allow CompilerControllers to access rustc_plugin::registry::Registry structure. 2016-09-04 03:22:56 +00:00
Vadim Petrochenkov
c2ca1530db Fix rebase + address comments 2016-09-03 13:39:34 +03:00
Vadim Petrochenkov
6792bd99fe Support unions in rustdoc 2016-09-03 13:39:34 +03:00
Vadim Petrochenkov
cbd912baba Add union types 2016-09-03 13:37:25 +03:00
Vadim Petrochenkov
4001c039de Add unions to HIR 2016-09-03 13:37:25 +03:00
bors
147371f58f Auto merge of #34982 - arielb1:bad-tuples-and-objects, r=nikomatsakis
Turn the RFC1592 warnings into hard errors

The warnings have already reached stable, and I want to improve the trait error reporting code.

Turning warnings into errors, this is obviously a [breaking-change].

r? @nikomatsakis

cc @rust-lang/compiler
2016-09-01 06:05:04 -07:00
Ariel Ben-Yehuda
7b92d05804 turn the RFC1592 warnings into hard errors
The warnings have already reached stable

The test rfc1592_deprecated is covered by `bad_sized` and
`unsized6`.

Fixes #33242
Fixes #33243
2016-09-01 13:34:56 +03:00
bors
2c01bb8851 Auto merge of #35718 - michaelwoerister:incr-comp-dir-locking, r=alexcrichton
Implement synchronization scheme for incr. comp. directory

This PR implements a copy-on-write-based synchronization scheme for the incremental compilation cache directory. For technical details, see the documentation at the beginning of `rustc_incremental/persist/fs.rs`.

The PR contains unit tests for some functions but for testing whether the scheme properly handles races, a more elaborate test setup would be needed. It would probably involve a small tool that allows to manipulate the incremental compilation directory in a controlled way and then letting a compiler instance run against directories in different states. I don't know if it's worth the trouble of adding another test category to `compiletest`, but I'd be happy to do so.

Fixes #32754
Fixes #34957
2016-08-31 12:56:15 -07:00
bors
71ee82a8aa Auto merge of #36066 - jseyfried:rollup, r=Manishearth
Batch up libsyntax breaking changes

Batch of the following syntax-[breaking-change] changes:
 - #35591: Add a field `span: Span` to `ast::Generics`.
 - #35618: Remove variant `Mod` of `ast::PathListItemKind` and refactor the remaining variant `ast::PathListKind::Ident` to a struct `ast::PathListKind_`.
 - #35480: Change uses of `Constness` in the AST to `Spanned<Constness>`.
  - c.f. `MethodSig`, `ItemKind`
 - #35728: Refactor `cx.pat_enum()` into `cx.pat_tuple_struct()` and `cx.pat_path()`.
 - #35850: Generalize the elements of lists in attributes from `MetaItem` to a new type `NestedMetaItem` that can represent a `MetaItem` or a literal.
 - #35917: Remove traits `AttrMetaMethods`, `AttributeMethods`, and `AttrNestedMetaItemMethods`.
  - Besides removing imports of these traits, this won't cause fallout.
 - Add a variant `Union` to `ItemKind` to future proof for `union` (c.f. #36016).
 - Remove inherent methods `attrs` and `fold_attrs` of `Annotatable`.
  - Use methods `attrs` and `map_attrs` of `HasAttrs` instead.

r? @Manishearth
2016-08-30 00:36:19 -07:00
Michael Woerister
004a7eb127 Fix rustbuild 2016-08-29 14:27:40 -04:00
Michael Woerister
206e7b6fc7 Add some features to flock. 2016-08-29 14:27:40 -04:00
Michael Woerister
6ef8198406 Move flock.rs from librustdoc to librustc_data_structures. 2016-08-29 14:27:40 -04:00
Oliver Middleton
b56d61cfd7 rustdoc: Fix associated consts in search results
Associated consts can appear in none trait impls so need to be treated
like methods when generating the search index.
2016-08-29 18:36:57 +01:00
Jeffrey Seyfried
c14ff2884d Rollup merge of #35917 - jseyfried:remove_attr_ext_traits, r=nrc
syntax: Remove traits `AttrMetaMethods`, `AttributeMethods`, and `AttrNestedMetaItemMethods`
2016-08-28 10:40:04 +00:00
Jeffrey Seyfried
6303640e85 Rollup merge of #35850 - SergioBenitez:master, r=nrc
Implement RFC#1559: allow all literals in attributes

Implemented rust-lang/rfcs#1559, tracked by #34981.
2016-08-28 10:38:19 +00:00
Jeffrey Seyfried
37f30173a0 Rollup merge of #35618 - jseyfried:ast_view_path_refactor, r=eddyb
Refactor `PathListItem`s

This refactors away variant `Mod` of `ast::PathListItemKind` and refactors the remaining variant `Ident` to a struct `ast::PathListItem_`.
2016-08-28 10:31:24 +00:00
Oliver Middleton
a7c671bb90 rustdoc: Add missing item types to page titles
Most pages include the item type in the title such as "Struct
std::vec::Vec". However it is missing from the pages for foreign
functions, type definitions, macros, statics and constants. This adds them
so for example, instead of a title of "std::u32::MAX" it is "Constant
std::u32::MAX" to match the others.
2016-08-27 17:00:36 +01:00
Jonas Schievink
5adf003b99 Use deterministic FnvHash{Map,Set} in rustdoc 2016-08-27 15:20:45 +02:00
Eduard Burtescu
7a8d4822d8 rustc: use Vec<Kind> in Substs, where Kind is a &TyS | &Region tagged pointer. 2016-08-27 01:15:07 +03:00
Eduard Burtescu
dffd238f8b rustc: pass ty::Region behind an interned 'tcx reference. 2016-08-27 01:15:06 +03:00
Eduard Burtescu
5222fa58a1 rustc: use accessors for Substs::{types,regions}. 2016-08-27 00:25:04 +03:00
Jeffrey Seyfried
bfb01bbb26 Refactor away AttrMetaMethods. 2016-08-25 20:41:40 +00:00
Jeffrey Seyfried
e264828b27 Refactor away AttributeMethods. 2016-08-25 20:41:39 +00:00
Jeffrey Seyfried
4eb08bb2ab Refactor away AttrNestedMetaItemMethods. 2016-08-25 20:41:32 +00:00
Sergio Benitez
8250a26b5b Implement RFC#1559: allow all literals in attributes. 2016-08-25 13:25:22 -07:00
Corey Farwell
42e8ac87eb Implement From<ast::FloatTy> for PrimitiveType. 2016-08-24 23:27:25 -07:00
Corey Farwell
168cfea8af Implement From<ast::UintTy> for PrimitiveType. 2016-08-24 23:27:25 -07:00
Corey Farwell
8a6f7a5ced Implement From<ast::IntTy> for PrimitiveType. 2016-08-24 23:27:25 -07:00
Corey Farwell
5c849f4a50 Remove unnecessary 'Primitive' prefix on PrimitiveType enum variants. 2016-08-24 23:27:25 -07:00
Corey Farwell
9dde563990 Stop reexporting PrimitiveType enum in librustdoc. 2016-08-24 23:27:24 -07:00
Corey Farwell
0c9ff54139 Migrate ItemType::from_type_kind to convert::From. 2016-08-24 23:25:26 -07:00
Corey Farwell
30397aee0d Migrate ItemType::from_item to convert::From. 2016-08-24 23:25:26 -07:00
Corey Farwell
7dc411667a Migrate Context::maybe_ignore_item method to standalone function.
The method wasn't using any `self` data from Context, so it seemed
miseading to implement it as a method.
2016-08-24 23:25:26 -07:00
Corey Farwell
28ecfb691d Move ItemEnum → Generics logic into method on ItemEnum. 2016-08-24 23:25:26 -07:00
bors
012f45eaf7 Auto merge of #35854 - nikomatsakis:incr-comp-cache-hash-35549, r=mw
compute and cache HIR hashes at beginning

This avoids the compile-time overhead of computing them twice.  It also fixes
an issue where the hash computed after typeck is differen than the hash before,
because typeck mutates the def-map in place.

Fixes #35549.
Fixes #35593.

Some performance measurements suggest this `HashesMap` is very small in memory (unobservable via `-Z time-passes`) and very cheap to construct. I do see some (very minor) performance wins in the incremental case after the first run -- the first run costs more because loading the dep-graph didn't have any hashing to do in that case. Example timings from two runs  of `libsyntex-syntax` -- the (1) indicates first run, (2) indicates second run, and (*) indicates both together:

| Phase | Master | Branch |
| ---- | ---- | ---- |
| compute_hashes_map (1) | N/A | 0.343 |
| load_dep_graph (1) | 0 | 0 |
| serialize dep graph (1) | 4.190 | 3.920 |
| total (1) | 4.190 | 4.260 |
| compute_hashes_map (2) | N/A | 0.344 |
| load_dep_graph (2) | 0.592 | 0.252 |
| serialize dep graph (2) | 4.119 | 3.779 |
| total (2) | 4.71 | 4.375 |
| total (*) | 8.9 | 8.635 |

r? @michaelwoerister
2016-08-23 11:53:17 -07:00
Jeffrey Seyfried
9d99fe98ad Fix fallout in rustdoc. 2016-08-21 22:59:40 +00:00
Jonathan Turner
d5595d1f3e Rollup merge of #35234 - nrc:rustdoc-macros, r=steveklabnik
rustdoc: remove the `!` from macro URLs and titles

Because the `!` is part of a macro use, not the macro's name. E.g., you write `macro_rules! foo` not `macro_rules! foo!`, also `#[macro_import(foo)]`.

(Pulled out of #35020).
2016-08-20 07:09:33 -07:00
Niko Matsakis
6bd80d1116 compute and cache HIR hashes at beginning
This avoids the compile-time overhead of computing them twice.  It also fixes
an issue where the hash computed after typeck is differen than the hash before,
because typeck mutates the def-map in place.

Fixes #35549.
Fixes #35593.
2016-08-20 07:26:14 -04:00
bors
f883b0bbab Auto merge of #35655 - ollie27:rustdoc_search_static_prim, r=steveklabnik
rustdoc: Fix a couple of issues with the search results

* Fix links to static items in the search results.
* Don't include the path for primitive methods in the search results. Displaying `std::u32::max_value` is misleading so just display `u32::max_value`.
2016-08-19 11:17:11 -07:00
Nick Cameron
301401e568 Redirect 2016-08-19 08:20:06 +12:00
Nick Cameron
da1f7731f6 rustdoc: remove the ! from macro URLs and titles 2016-08-18 15:40:56 +12:00
bors
6c0d66af69 Auto merge of #35236 - nrc:rustdoc-redirects, r=@alexcrichton
rustdoc: redirect URLs

cc #35020 which does this properly

r? @alexcrichton
2016-08-17 03:20:13 -07:00
Nick Cameron
879637f7b0 Review changes 2016-08-17 16:12:37 +12:00
Eduard Burtescu
9453d9b8ad rustc: remove ParamSpace from Substs. 2016-08-17 06:32:00 +03:00
Eduard Burtescu
6f5e455c2d rustc: split GenericPredicates of a method from its parent predicates. 2016-08-17 05:50:57 +03:00
Eduard Burtescu
3e74e5bffe rustc: split Generics of a method from its parent Generics. 2016-08-17 05:50:57 +03:00
Eduard Burtescu
c1cfd58cbd rustc: remove SelfSpace from ParamSpace. 2016-08-17 05:50:57 +03:00
Eduard Burtescu
4158673ad7 rustc: reduce Substs and Generics to a simple immutable API. 2016-08-17 05:50:57 +03:00
Eduard Burtescu
4b25f08512 rustc: move trait objects from TraitRef to ExistentialTraitRef. 2016-08-17 05:50:57 +03:00
Eduard Burtescu
77dc61b5c6 rustc: force all raw accesses to VecPerParamSpace through as_full_slice. 2016-08-17 05:50:57 +03:00
Eduard Burtescu
e314636b86 rustc: use Vec instead of VecPerParamSpace for ty::GenericPredicates. 2016-08-17 05:50:57 +03:00
Nick Cameron
77ca7dd107 rustdoc: redirects from sane, namespaced URLs to Rustdoc's ridiculous ones
cc #35020 which does this properly
2016-08-17 10:30:39 +12:00