Jack Huey
476bd53058
Cleanup
2021-01-16 18:50:34 -05:00
Mara Bos
1368e81bcb
Rollup merge of #81021 - CraftSpider:rustdoc-remove-import, r=jyn514
...
Remove doctree::Import
Per the title. Part of cleaning up doctree
2021-01-16 17:30:08 +00:00
Joshua Nelson
d11855a8ce
Rename VariantKind -> Variant
...
There's no `Variant`, so it seems silly to have `Kind`.
2021-01-15 13:55:03 -05:00
Joshua Nelson
dd459a2be6
Remove useless clean::Variant struct
...
It had exactly one field and no special behavior, so there was no point.
2021-01-15 13:54:59 -05:00
Rune Tynan
2a0c9e28cb
Address nit
2021-01-15 12:50:04 -05:00
Rune Tynan
e3274fd148
Remove doctree::Import
2021-01-15 12:49:45 -05:00
Rune Tynan
c54678ab2f
Remove doctree::Variant
2021-01-14 15:21:44 -05:00
bors
c7b0ddbffe
Auto merge of #80802 - jyn514:box-attributes, r=nnethercote
...
Box Item::Attributes
This reduces the size of Item from 128 to 40 bytes. I think this is as small as it needs to get 🎉
Builds on https://github.com/rust-lang/rust/pull/80339 and should not be merged before.
r? `@GuillaumeGomez`
2021-01-14 02:26:46 +00:00
bors
a62a76047e
Auto merge of #77524 - Patryk27:fixes/66228, r=estebank
...
Rework diagnostics for wrong number of generic args (fixes #66228 and #71924 )
This PR reworks the `wrong number of {} arguments` message, so that it provides more details and contextual hints.
2021-01-13 20:35:58 +00:00
Joshua Nelson
a8ff647deb
Separate out a hir::Impl struct
...
This makes it possible to pass the `Impl` directly to functions, instead
of having to pass each of the many fields one at a time. It also
simplifies matches in many cases.
2021-01-12 20:32:33 -05:00
Joshua Nelson
690aeaf087
Box Item::attributes
...
This reduces the size of Item from 136 to 48 bytes.
2021-01-10 10:39:36 -05:00
Patryk Wychowaniec
d2f8e398f1
Rework diagnostics for wrong number of generic args
2021-01-10 13:07:40 +01:00
bors
34628e5b53
Auto merge of #80867 - JohnTitor:rollup-tvqw555, r=JohnTitor
...
Rollup of 9 pull requests
Successful merges:
- #79502 (Implement From<char> for u64 and u128.)
- #79968 (Improve core::ptr::drop_in_place debuginfo)
- #80774 (Fix safety comment)
- #80801 (Use correct span for structured suggestion)
- #80803 (Remove useless `fill_in` function)
- #80820 (Support `download-ci-llvm` on NixOS)
- #80825 (Remove under-used ImplPolarity enum)
- #80850 (Allow #[rustc_builtin_macro = "name"])
- #80857 (Add comment to `Vec::truncate` explaining `>` vs `>=`)
Failed merges:
r? `@ghost`
`@rustbot` modify labels: rollup
2021-01-10 08:01:12 +00:00
Yuki Okushi
5acac4c979
Rollup merge of #80825 - GuillaumeGomez:rustdoc-cleanup-bis-repetita, r=jyn514
...
Remove under-used ImplPolarity enum
It doesn't make much sense to have an enum with only two possible values and to store it inside an `Option` in my opinion when you can do all the same with a simple boolean. I don't expect any chances, performance or RSS usage wise.
r? ``@jyn514``
2021-01-10 16:56:03 +09:00
Yuki Okushi
c2bbd0c697
Rollup merge of #80803 - jyn514:cleanup-fill-in, r=GuillaumeGomez
...
Remove useless `fill_in` function
It was only used once, in a function that was otherwise trivial.
2021-01-10 16:56:00 +09:00
bors
7a193921a0
Auto merge of #77862 - danielhenrymantilla:rustdoc/fix-macros_2_0-paths, r=jyn514,petrochenkov
...
Rustdoc: Fix macros 2.0 and built-in derives being shown at the wrong path
Fixes #74355
- ~~waiting on author + draft PR since my code ought to be cleaned up _w.r.t._ the way I avoid the `.unwrap()`s:~~
- ~~dummy items may avoid the first `?`,~~
- ~~but within the module traversal some tests did fail (hence the second `?`), meaning the crate did not possess the exact path of the containing module (`extern` / `impl` blocks maybe? I'll look into that).~~
r? `@jyn514`
2021-01-10 05:15:01 +00:00
Guillaume Gomez
34d128a263
Replace under-used ImplPolarity enum with a boolean
2021-01-09 14:59:37 +01:00
Guillaume Gomez
3338bdb23d
Add doc comment explaining what the second Array's field is about
2021-01-08 22:43:53 +01:00
Yuki Okushi
dec3dbd36a
Rollup merge of #80799 - jyn514:pretty-print, r=CraftSpider
...
Get rid of custom pretty-printing in rustdoc
and use rustc_hir_pretty directly instead.
Closes https://github.com/rust-lang/rust/issues/79497 .
r? `@CraftSpider`
2021-01-08 11:11:50 +09:00
Yuki Okushi
faf5412cd1
Rollup merge of #80794 - LingMan:map_or, r=jyn514
...
Use Option::map_or instead of `.map(..).unwrap_or(..)`
r? `@jyn514`
`@rustbot` modify labels +C-cleanup +T-rustdoc
2021-01-08 11:11:48 +09:00
Joshua Nelson
d72f58009f
Remove useless fill_in function
...
It was only used once, in a function that was otherwise trivial.
2021-01-07 20:42:51 -05:00
Joshua Nelson
31375d2074
Get rid of custom pretty-printing in rustdoc
...
and use rustc_hir_pretty directly instead
2021-01-07 17:44:59 -05:00
LingMan
961f9ee6df
Use Option::map_or instead of .map(..).unwrap_or(..)
2021-01-07 20:03:59 +01:00
Daniel Henry-Mantilla
ce3ecd612f
Style nit: avoid confusing name shadowing in pattern match
...
Co-authored-by: Joshua Nelson <joshua@yottadb.com>
2021-01-06 15:13:39 +01:00
Daniel Henry-Mantilla
aa863caebe
Style nit: replace for_each & return with for & continue
...
Co-Authored-By: Joshua Nelson <jyn514@gmail.com>
2021-01-06 15:13:38 +01:00
Camelid
7428e2d134
Apply suggestions from code review
...
Co-authored-by: Joshua Nelson <joshua@yottadb.com>
2021-01-05 19:46:51 -08:00
Camelid
e636805eee
rustdoc: Turn next_def_id comments into docs
2021-01-05 19:04:49 -08:00
bors
6163bfdcce
Auto merge of #80661 - jyn514:duplicate-types, r=GuillaumeGomez
...
Cleanup rustdoc handling of associated types
This is best reviewed a commit at a time. No particular reason for these changes, they just stood out as I was reviewing https://github.com/rust-lang/rust/pull/80653 and thinking about https://github.com/rust-lang/rust/issues/80379 . The new test case worked before, it just wasn't tested.
r? `@GuillaumeGomez`
2021-01-04 10:32:28 +00:00
Joshua Nelson
24ef94593c
Don't clone type_ unnecessarily
2021-01-03 16:10:46 -05:00
Joshua Nelson
a786eaac1f
Simplify rustdoc handling of type aliases for associated types
...
The logic was very hard to follow before.
2021-01-03 15:40:41 -05:00
Guillaume Gomez
ff1f21a8fd
Rollup merge of #80628 - matthiaskrgr:match_ref_pats, r=varkor
...
reduce borrowing and (de)referencing around match patterns (clippy::match_ref_pats)
2021-01-03 17:09:11 +01:00
Matthias Krüger
8a90626a46
reduce borrowing and (de)referencing around match patterns (clippy::match_ref_pats)
2021-01-02 20:09:17 +01:00
Guillaume Gomez
4ba1928fa2
Improve code for DocFragment rework
2021-01-02 19:16:27 +01:00
Guillaume Gomez
122b141f58
End of rework of Attributes struct
2021-01-02 16:55:12 +01:00
Guillaume Gomez
c4739bc920
Rework DocFragment
2021-01-02 16:55:12 +01:00
Matthias Krüger
a5807ac61c
clippy fixes for librustdoc
...
fixes clippy warnings of type:
match_like_matches_macro
or_fun_call
op_ref
needless_return
let_and_return
single_char_add_str
useless_format
unnecessary_sort_by
match_ref_pats
redundant_field_names
2021-01-01 21:19:10 +01:00
Rémy Rakic
1fc3c4c16d
adjust const generics defaults FIXMEs to the new feature gate
2021-01-01 11:01:01 +01:00
Julian Knodt
61f33bfd29
first pass at default values for const generics
...
- Adds optional default values to const generic parameters in the AST
and HIR
- Parses these optional default values
- Adds a `const_generics_defaults` feature gate
2021-01-01 10:55:10 +01:00
Dylan DPC
7d247c9246
Rollup merge of #80368 - camelid:rustdoc-succinct-vis, r=jyn514
...
rustdoc: Render visibilities succinctly
Fixes #79139 .
r? `@jyn514`
2020-12-31 22:20:49 +01:00
bors
a6bd5246da
Auto merge of #80267 - 0urobor0s:ouro/61592, r=jyn514
...
Rustdoc render public underscore_imports as Re-exports
Fixes #61592
2020-12-31 09:07:52 +00:00
bors
cb4553bdae
Rustdoc render public underscore_imports as Re-exports
...
Fixes #61592
2020-12-31 09:07:51 +00:00
Camelid
f7f14f6f0b
Add note on panic behavior
2020-12-30 17:39:26 -08:00
Camelid
6f6afae41a
Small refactor
2020-12-30 16:41:18 -08:00
Camelid
75705ab3a9
Update find_nearest_parent_module
2020-12-30 16:38:25 -08:00
Mara Bos
9e8edc8c22
Rollup merge of #80495 - jyn514:rename-empty, r=petrochenkov
...
Rename kw::Invalid -> kw::Empty
See https://rust-lang.zulipchat.com/#narrow/stream/182449-t-compiler.2Fhelp/topic/Is.20there.20a.20symbol.20for.20the.20empty.20string.3F/near/220054471
for context.
r? `@petrochenkov`
2020-12-30 20:56:58 +00:00
Jonas Schievink
7786a6b334
Add Iterator::intersperse
2020-12-30 12:07:19 -08:00
Joshua Nelson
edeac1778c
Rename kw::Invalid -> kw::Empty
...
See https://rust-lang.zulipchat.com/#narrow/stream/182449-t-compiler.2Fhelp/topic/Is.20there.20a.20symbol.20for.20the.20empty.20string.3F/near/220054471
for context.
2020-12-30 09:50:02 -05:00
Matthias Krüger
17a8c1017f
don't clone copy types
2020-12-29 19:40:03 +01:00
bors
158f8d034b
Auto merge of #80014 - jyn514:box-item-kind, r=nnethercote
...
[rustdoc] Box ItemKind to reduce the size of `Item`
This brings the size of `Item` from
```
[src/librustdoc/lib.rs:103] std::mem::size_of::<Item>() = 536
```
to
```
[src/librustdoc/lib.rs:103] std::mem::size_of::<Item>() = 136
```
This is an alternative to https://github.com/rust-lang/rust/pull/79967 ; I don't think it makes sense to make both changes.
Helps with #79103 .
2020-12-29 10:41:01 +00:00
Joshua Nelson
5fce0dd787
Add static assertion for the size of ItemKind
2020-12-29 00:43:25 -05:00