Guillaume Gomez
edec5807ac
Hide items if they use default docs
2018-10-21 18:28:27 +02:00
Oliver Scherer
3c9258e604
Prefer Default::default
over FxHash*::default
in struct constructors
2018-10-19 14:34:44 +02:00
Oliver Scherer
ee81739dc1
Deprecate the FxHashMap()
and FxHashSet()
constructor function hack
2018-10-19 14:34:44 +02:00
Guillaume Gomez
c5a025aae6
Fix mobile doc display
2018-10-11 22:23:39 +02:00
QuietMisdreavus
967a6b0241
show "all items" link even if crate doesn't have a version
2018-09-27 09:12:13 -05:00
QuietMisdreavus
63ac3c7b94
add attributes/derives to "all items" page
2018-09-27 09:04:38 -05:00
QuietMisdreavus
27429d9415
add derive macros' helper attributes to doc output
2018-09-26 13:40:08 -05:00
QuietMisdreavus
869ebc4f95
add declaration blocks to attribute/derive pages
2018-09-26 09:18:58 -05:00
QuietMisdreavus
aea1bd0a59
handle proc-macros as macros instead of functions
2018-09-25 14:56:43 -05:00
QuietMisdreavus
354507e61f
shuffle ownership of external_traits
...
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-20 05:54:26 -05:00
QuietMisdreavus
c754e8240c
refactor: move access_levels
into RenderInfo
2018-09-20 05:42:38 -05:00
QuietMisdreavus
e854d39929
don't index trait impls if the trait isn't also documented
2018-09-20 05:42:36 -05:00
QuietMisdreavus
a893117f38
add a bunch of debug prints
2018-09-20 05:42:27 -05:00
Guillaume Gomez
6aed133ebd
Rollup merge of #54097 - GuillaumeGomez:remove-keyword-namespace, r=QuietMisdreavus
...
rustdoc: Remove namespace for keywords
Fixes #54084 .
r? @QuietMisdreavus
2018-09-18 10:21:35 +02:00
Guillaume Gomez
3466d8044f
Rollup merge of #53941 - kzys:sort-impls, r=GuillaumeGomez
...
rustdoc: Sort implementors
Fixes #53812
2018-09-16 12:25:41 +02:00
bors
e7f1880921
Auto merge of #52962 - GuillaumeGomez:few-things, r=QuietMisdreavus
...
Fix trait item doc setting, add new setting, start hiding elements by default and then showing them up
r? @QuietMisdreavus
2018-09-14 01:07:21 +00:00
Kazuyoshi Kato
3dbb741a4b
rustdoc: Sort implementors
...
Fixes #53812
2018-09-12 21:01:14 -07:00
bors
f2302daef3
Auto merge of #53409 - GuillaumeGomez:associated-const-value, r=QuietMisdreavus
...
Don't show associated const value anymore
Part of #44348 .
Before:
<img width="1440" alt="screen shot 2018-08-16 at 00 48 30" src="https://user-images.githubusercontent.com/3050060/44177414-20ef1480-a0ee-11e8-80d4-7caf082cf0de.png ">
After:
<img width="1440" alt="screen shot 2018-08-16 at 00 48 23" src="https://user-images.githubusercontent.com/3050060/44177417-251b3200-a0ee-11e8-956a-4229275e3342.png ">
cc @nox
r? @QuietMisdreavus
2018-09-12 21:20:05 +00:00
Guillaume Gomez
1a0e8f95f5
Remove namespace for keywords
2018-09-10 11:27:21 +02:00
Oliver Middleton
d3e56854e1
rustdoc: Remove generated blanket impls from trait pages
2018-09-09 18:27:05 +01:00
Guillaume Gomez
c1b1d6804b
Don't show default docs
2018-09-06 23:32:30 +02:00
Guillaume Gomez
d65c8636d9
Fix hover on impls
2018-09-06 23:32:30 +02:00
kennytm
f37081499b
Rollup merge of #53801 - GuillaumeGomez:duplicated-foreign-type-impls, r=QuietMisdreavus
...
Prevent duplicated impl on foreign types
Fixes #53689 .
r? @QuietMisdreavus
2018-09-01 21:14:15 +08:00
bors
aaa170bebe
Auto merge of #51384 - QuietMisdreavus:extern-version, r=GuillaumeGomez
...
rustdoc: add flag to control the html_root_url of dependencies
The `--extern-html-root-url` flag in this PR allows one to override links to crates whose docs are not already available locally in the doc bundle. Docs.rs currently uses a version of this to make sure links to other crates go into that crate's docs.rs page. See the included test for intended use, but the idea is as follows:
Calling rustdoc with `--extern-html-root-url crate=https://some-url.com ` will cause rustdoc to override links that point to that crate to instead be replaced with a link rooted at `https://some-url.com/ `. (e.g. for docs.rs this would be `https://docs.rs/crate/0.1.0 ` or the like.) Cheekily, rustup could use these options to redirect links to std/core/etc to instead point to locally-downloaded docs, if it so desired.
Fixes https://github.com/rust-lang/rust/issues/19603
2018-08-31 17:39:28 +00:00
Guillaume Gomez
3b98571b32
Prevent duplicated impl on foreign types
2018-08-29 23:02:05 +02:00
Eduard-Mihai Burtescu
93f3f5b155
Use FxHash{Map,Set} instead of the default Hash{Map,Set} everywhere in rustc.
2018-08-28 17:04:04 +03:00
Guillaume Gomez
86141797db
Remove static and const initialization from documentation
2018-08-26 12:08:30 +02:00
Guillaume Gomez
a54594430f
Don't show associated const value anymore
2018-08-25 15:30:47 +02:00
Matthias Krüger
ede1f7d2a5
use String::new() instead of String::from(""), "".to_string(), "".to_owned() or "".into()
2018-08-23 10:14:52 +02:00
kennytm
b5519db323
Rollup merge of #53496 - matthiaskrgr:codespell_08_2018, r=varkor
...
Fix typos found by codespell.
2018-08-21 17:51:49 +08:00
Donato Sciarra
82607d2cf3
mv (mod) codemap source_map
2018-08-19 23:01:00 +02:00
Matthias Krüger
71120ef1e5
Fix typos found by codespell.
2018-08-19 17:41:28 +02:00
Eduard-Mihai Burtescu
14aed81d9a
Use the new Entry::or_default method where possible.
2018-08-18 20:19:45 +03: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
Guillaume Gomez
2462cdb71d
Fix trait item doc setting, add new setting, start hiding elements by default and then showing them up
2018-08-02 00:19:04 +02: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
Mark Rousskov
01d95558e6
Further extract error code switch
...
Removes dependency on UnstableFeatures from markdown rendering
2018-07-31 11:39:02 -06:00
bors
7bbcd005b3
Auto merge of #52805 - ljedrz:format_str_literal, r=petrochenkov
...
Don't format!() string literals
Prefer `to_string()` to `format!()` take 2, this time targetting string literals. In some cases (`&format!("...")` -> `"..."`) also removes allocations. Occurences of `format!("")` are changed to `String::new()`.
2018-07-30 06:29:39 +00:00
bors
023fd7e74a
Auto merge of #52767 - ljedrz:avoid_format, r=petrochenkov
...
Prefer to_string() to format!()
Simple benchmarks suggest in some cases it can be faster by even 37%:
```
test converting_f64_long ... bench: 339 ns/iter (+/- 199)
test converting_f64_short ... bench: 136 ns/iter (+/- 34)
test converting_i32_long ... bench: 87 ns/iter (+/- 16)
test converting_i32_short ... bench: 87 ns/iter (+/- 49)
test converting_str ... bench: 54 ns/iter (+/- 15)
test formatting_f64_long ... bench: 349 ns/iter (+/- 176)
test formatting_f64_short ... bench: 145 ns/iter (+/- 14)
test formatting_i32_long ... bench: 98 ns/iter (+/- 14)
test formatting_i32_short ... bench: 93 ns/iter (+/- 15)
test formatting_str ... bench: 86 ns/iter (+/- 23)
```
2018-07-29 09:33:37 +00:00
bors
a5c2d0fffa
Auto merge of #52764 - sinkuu:cleanup, r=nikomatsakis
...
Misc cleanups
2018-07-29 06:32:24 +00:00
bors
dab71516f1
Auto merge of #52585 - GuillaumeGomez:generic-impls, r=QuietMisdreavus
...
[rustdoc] Generic impls
Fixes #33772 .
r? @QuietMisdreavus
2018-07-28 20:44:17 +00:00
ljedrz
421b2ba347
Don't format!() string literals
2018-07-28 17:58:52 +02:00
Guillaume Gomez
7a3c7b2097
Don't display full blanket implementation and put it into its own section
2018-07-28 15:18:38 +02:00
kennytm
59f8422a17
Rollup merge of #52781 - ljedrz:avoid_vec_arguments, r=nikomatsakis
...
Use a slice where a vector is not necessary
2018-07-28 16:25:07 +08:00
ljedrz
1cca420435
Use slices where a vector is not necessary
2018-07-27 16:50:28 +02:00
Shotaro Yamada
3525368a56
Use str::repeat
2018-07-27 23:26:36 +09:00
ljedrz
57a5a9b054
Prefer to_string() to format!()
2018-07-27 11:11:18 +02:00
Tatsuyuki Ishi
66c4dc9769
Add missing dyn
2018-07-25 10:24:31 +09:00
Guillaume Gomez
d64c2ac01a
Improve code
2018-07-22 21:03:21 +02:00