4077 Commits

Author SHA1 Message Date
Guillaume Gomez
34956ac0f6
Rollup merge of #53267 - GuillaumeGomez:fix-styles, r=QuietMisdreavus
Fix styles

Fixes #53262.

r? @QuietMisdreavus
2018-08-12 23:27:02 +02:00
Guillaume Gomez
b0d7f91c4e
Rollup merge of #53253 - GuillaumeGomez:remove-console, r=kennytm
Remove unwanted console log

Forgot to remove a `console.log`, now it's fixed.

r? @QuietMisdreavus
2018-08-12 23:26:59 +02:00
Guillaume Gomez
3e9a1a1b82
Rollup merge of #53230 - memoryruins:nll_bootstrap_4, r=nikomatsakis
[nll] enable feature(nll) on various crates for bootstrap: part 4

#53172

r? @nikomatsakis
2018-08-12 23:26:56 +02:00
Guillaume Gomez
5a801c89d0 Fix styles 2018-08-11 13:34:15 +02:00
Guillaume Gomez
e37391b389 Remove unwanted console log 2018-08-10 18:48:36 +02:00
memoryruins
4aced68e18 [nll] librustdoc: enable feature(nll) for bootstrap 2018-08-09 15:35:06 -04:00
QuietMisdreavus
0511b01506 set the syntax edition in the driver's phase 1 2018-08-09 11:46:39 -05:00
kennytm
dad5b6c554
Rollup merge of #53094 - GuillaumeGomez:automatic-expand, r=nrc
Automatically expand section if url id point to one of its component

Fixes #52517.

r? @nrc
2018-08-09 16:58:41 +08:00
kennytm
c6f55bca7f
Rollup merge of #52773 - ljedrz:unncecessary_patterns, r=nikomatsakis
Avoid unnecessary pattern matching against Option and Result
2018-08-09 16:58:39 +08:00
Mark Rousskov
3baec3cdd7 Add HirId to VisibilityKind::Restricted 2018-08-07 10:13:17 -06:00
kennytm
25e32903ef
Rollup merge of #53060 - iliekturtles:rustdoc-style, r=GuillaumeGomez
Change rustdoc style so fully qualified name does not overlap src link

A type's fully qualified name will now wrap once it gets to the
`[-][src]` link aligned against the right edge of the content area.
Previously the two would overlap and the name would only wrap when
hitting the edge of the content area.

Before:
![image](https://user-images.githubusercontent.com/5081378/43676506-cf548758-97c0-11e8-80a0-a812d8ea0eef.png)

After:
![image](https://user-images.githubusercontent.com/5081378/43676509-e78810a6-97c0-11e8-8cd4-b90bd5858a5f.png)
2018-08-07 16:55:41 +08:00
ljedrz
44d32d4413 Avoid unnecessary pattern matching against Option and Result 2018-08-07 10:24:27 +02:00
bors
b239743753 Auto merge of #52644 - varkor:lib-feature-gate-2, r=withoutboats
Add errors for unknown, stable and duplicate feature attributes

- Adds an error for unknown (lang and lib) features.
- Extends the lint for unnecessary feature attributes for stable features to libs features (this already exists for lang features).
- Adds an error for duplicate (lang and lib) features.

```rust
#![feature(fake_feature)] //~ ERROR unknown feature `fake_feature`

#![feature(i128_type)] //~ WARNING the feature `i128_type` has been stable since 1.26.0

#![feature(non_exhaustive)]
#![feature(non_exhaustive)] //~ ERROR duplicate `non_exhaustive` feature attribute
```

Fixes #52053, fixes #53032 and address some of the problems noted in #44232 (though not unused features).

There are a few outstanding problems, that I haven't narrowed down yet:
- [x] Stability attributes on macros do not seem to be taken into account.
- [x] Stability attributes behind `cfg` attributes are not taken into account.
- [x] There are failing incremental tests.
2018-08-06 16:58:27 +00:00
bors
4b8089daf8 Auto merge of #52990 - Aaron1011:fix/rustdoc-auto-trait-static, r=eddyb
Fix ICE when rustdoc encounters certain usages of HRTBs

Fixes #51236

Under certain circumstances, `AutoTraitFinder` could end up computing a `ParamEnv` involving two trait predicates that differed only in the region parameters involved. One of these parameters would be a HRTB, while the other would be a normal region parameter.

When this `ParamEnv` was later passed to `SelectionContext`, an `Ambiguity` error would occur, since the erased versions of these predicates would be identical. To solve the issue, we de-duplicate our list of predicates as we build it up. Whenever we encounter two predicates that differ only in their assignment of region parameters (a HRTB vs a normal lifetime parameter), we pick the HRTB. This corresponds to selecting a 'stricter' bound to display in the generated documentation: we're requiring that a particular type works for all possible lifetime parameters if it's going to implement a particular auto trait.
2018-08-06 14:07:22 +00:00
Guillaume Gomez
c70eb4b6ea Automatically expand section if url id point to one of its component 2018-08-05 19:44:10 +02:00
varkor
d19832105e Remove bad features after rebase 2018-08-05 15:54:49 +01:00
varkor
c81b95f305 Remove unnecessary feature attributes that sneaked in 2018-08-05 15:54:49 +01:00
Mike Boutin
3f92ff34b5 Change rustdoc style so fully qualified names do not overlap src links
A type's fully qualified name will now wrap once it gets to the
`[-][src]` link aligned against the right edge of the content area.
Previously the two would overlap and the name would only wrap when
hitting the edge of the content area. The `[-][src]` link will main at
the top of the header.
2018-08-05 10:43:04 -04:00
QuietMisdreavus
323b2b71ec only abort after all early passes have run 2018-08-04 22:20:45 -05:00
QuietMisdreavus
bef0f2576d don't process intra-links on extern-crate items 2018-08-04 22:20:45 -05:00
QuietMisdreavus
9e4e266877 turn intra-doc-link collection into an early pass 2018-08-04 22:20:45 -05:00
QuietMisdreavus
d3d6f76887 introduce "early passes" an convert a few over 2018-08-04 18:49:57 -05:00
QuietMisdreavus
aaec1014d8 strongly-typed passes 2018-08-04 18:44:05 -05:00
bors
667fdc1ce4 Auto merge of #52827 - GuillaumeGomez:generic-impls, r=QuietMisdreavus
rustdoc: clean up generic impls

r? @QuietMisdreavus
2018-08-04 21:20:26 +00:00
bors
94c3c340cc Auto merge of #52758 - Mark-Simulacrum:session-cleanup, r=pnkfelix
Cleanup for librustc::session

Some rather straightforward cleanup. Each commit mostly stands alone.
2018-08-04 18:22:39 +00:00
Mark Rousskov
5fcef251d3 Move basic_options to impl of Default 2018-08-04 06:54:36 -06:00
Mark Rousskov
2a9344206b Normalize variants of CrateType to standard style
This is a clippy-breaking change.
2018-08-04 06:53:15 -06:00
Guillaume Gomez
d57f3a61c4 Update to master 2018-08-04 11:40:56 +02:00
kennytm
b643351c08
Rollup merge of #53050 - carols10cents:rustdoc-moar-room, r=GuillaumeGomez
Make left column of rustdoc search results narrower

To make more room for the description of the item

The description often has useful text that helps disambiguate between search results, but very little of it is shown.

As a side effect, this breaks the alignment between the search results and the "In Return Types" tab, which tends to line up above the description-- up until I started investigating this, I thought "In Names"/"In Parameters"/"In Return Types" were column headers and I just never saw search results that had info for the "In Parameters" middle column! Now, with the two columns of search results each taking up about a half, they look more like tabs than column headers.

Types that are long still wrap and look good-- I made some artificially long types in the following screenshots.

Before screenshot:

<img width="1258" alt="screen shot 2018-08-03 at 8 32 35 pm" src="https://user-images.githubusercontent.com/193874/43670805-56e3b3b4-975e-11e8-9296-600837d03de2.png">

After screenshot:

<img width="1239" alt="screen shot 2018-08-03 at 8 31 17 pm" src="https://user-images.githubusercontent.com/193874/43670810-6591f9ac-975e-11e8-9e12-4ea9ab1e5806.png">
2018-08-04 17:20:10 +08:00
Guillaume Gomez
0bff861d32 Remove FinderTrait and move its functions into DocContext 2018-08-04 11:02:25 +02:00
Guillaume Gomez
fc81adb3c2 Improve functions naming 2018-08-04 11:02:00 +02:00
Guillaume Gomez
2758de4b95 Fix dyn objects 2018-08-04 11:02:00 +02:00
Guillaume Gomez
8301081c90 Fix primitive blanket impls not showing up 2018-08-04 11:02:00 +02:00
Guillaume Gomez
4aba7de2a7 Clean generic impls code 2018-08-04 11:02:00 +02:00
kennytm
aefa307c1f
Rollup merge of #53047 - integer32llc:rustdoc-clicky-clicky, r=QuietMisdreavus
Make entire row of doc search results clickable

By adding empty `after` content that clears and is `display: block`.
Technique found here: https://stackoverflow.com/a/7817313/51683

Now any part of a documentation search result that is highlighted when
you hover over it should also be clickable.

NOTE: THE BELOW IMAGES ARE GIFS BUT I DIDN'T MAKE THEM LOOP, OPEN IN A NEW TAB TO SEE THEM SORRY SORRY

Here's what happens before this change: my mouse cursor is in the middle of the table cell, and the row is highlighted which makes it look like clicking should have an effect, but clicking doesn't do anything:

![rustdoc-clicky-clicky-before](https://user-images.githubusercontent.com/193874/43668604-d1e63392-974b-11e8-99f5-e7e11c9056e8.gif)

After this change, clicking in the middle of the cell works!

![rustdoc-clicky-clicky-after](https://user-images.githubusercontent.com/193874/43668616-e522fa08-974b-11e8-8409-3826d586d1f7.gif)

It even works nicely when the type is really long and wraps! (I created the type artificially because I couldn't find a long enough one in the wild)

![rustdoc-clicky-clicky-after-long](https://user-images.githubusercontent.com/193874/43668639-f962a75c-974b-11e8-9218-70bf068387a3.gif)
2018-08-04 14:36:02 +08:00
kennytm
e8060a4229
Rollup merge of #53041 - GuillaumeGomez:fix-code-css-rule, r=QuietMisdreavus
Fix invalid code css rule

Fixes #53017.

r? @QuietMisdreavus
2018-08-04 14:36:00 +08:00
kennytm
7a23b5dec3
Rollup merge of #53003 - GuillaumeGomez:stabilize-rustdoc-options, r=QuietMisdreavus
Stabilize --color and --error-format options in rustdoc

Fixes #52980

cc @kennytm

r? @QuietMisdreavus
2018-08-04 14:35:56 +08:00
Carol (Nichols || Goulding)
d5dd37b00f
Make left column of rustdoc search results narrower
To make more room for the description of the item
2018-08-03 20:39:58 -04:00
Carol (Nichols || Goulding)
11ffeed1ed
Make entire row of doc search results clickable
By adding empty `after` content that clears and is `display: block`.
Technique found here: https://stackoverflow.com/a/7817313/51683

Now any part of a documentation search result that is highlighted when
you hover over it should also be clickable.
2018-08-03 18:29:49 -04:00
Guillaume Gomez
110e7270ab Improve unstable message display 2018-08-04 00:02:46 +02:00
Guillaume Gomez
e2cda7dd82 Fix invalid code css rule 2018-08-03 23:30:16 +02:00
Mark Rousskov
6fdd6f65ca Move unused trait functions to inherent functions 2018-08-03 11:44:09 -06:00
Mark Rousskov
5aec365cb9 Store concrete crate stores where possible 2018-08-03 11:09:49 -06:00
Guillaume Gomez
dda85abf09 Stabilize --color and --error-format options in rustdoc 2018-08-02 22:54:09 +02:00
Aaron Hill
bff08f2731
Fix rustdoc crash when 'static bound appears in struct declaration 2018-08-02 09:58:44 -04:00
Pietro Albini
f52ef3b839
Rollup merge of #52835 - GuillaumeGomez:ice-rustdoc-links, r=eddyb
Fix Alias intra doc ICE

Fixes #52611.

cc @QuietMisdreavus

r? @varkor
2018-08-01 21:46:27 +02:00
Mark Rousskov
4cd004775c Add dyn to Write 2018-07-31 17:55:12 -06:00
Mark Rousskov
8e65a46268 Cleanup highlighting code
Removes some unused code and de-publicizes structs
2018-07-31 17:55:12 -06:00
Mark Rousskov
7bea518d3a Remove global derive_id and reset_ids functions
Previously these functions relied on TLS but we can instead thread the
relevant state through explicitly.
2018-07-31 17:55:12 -06:00
Guillaume Gomez
d94bdf8c66 Put back original field discovery 2018-07-31 21:43:29 +02:00