about summary refs log tree commit diff
path: root/src/librustdoc/clean
AgeCommit message (Collapse)AuthorLines
2022-08-02Rollup merge of #100005 - GuillaumeGomez:cleanup-ast-attr-clean, r=notriddleMatthias Krüger-17/+13
Remove Clean trait for ast::Attribute and improve Attributes::from_ast I prefer to keep this commit on its own for this PR because I'm changing a bit more things than expected originally: I split `Attributes::from_ast` into two because there is only one location making use of its second parameter. Follow-up of https://github.com/rust-lang/rust/pull/99638. r? `@notriddle`
2022-08-02fix rustdoc regressionAli MJ Al-Nasrawy-1/+4
2022-08-02Remove Clean trait implementation for ast::Attribute and cleanup ↵Guillaume Gomez-17/+13
Attributes::from_ast function by splitting it in two
2022-08-02Remove Clean trait implementation for hir::LifetimeGuillaume Gomez-20/+20
2022-08-02Remove Clean trait implementation for ty::TraitRefGuillaume Gomez-14/+8
2022-08-01Remove DefId from AssocItemContainer.Camille GILLOT-11/+11
2022-08-01Remove visibility from AssocItem.Camille GILLOT-1/+1
2022-08-01Store associated item defaultness in impl_defaultness.Camille GILLOT-5/+5
2022-08-01Rollup merge of #100003 - nnethercote:improve-size-assertions, r=lqdMatthias Krüger-39/+16
Improve size assertions. - For any file with four or more size assertions, move them into a separate module (as is already done for `hir.rs`). - Add some more for AST nodes and THIR nodes. - Put the `hir.rs` ones in alphabetical order. r? `@lqd`
2022-08-01Improve size assertions.Nicholas Nethercote-39/+16
- For any file with four or more size assertions, move them into a separate module (as is already done for `hir.rs`). - Add some more for AST nodes and THIR nodes. - Put the `hir.rs` ones in alphabetical order.
2022-07-31Remove Clean trait implementation for hir::TypeBindingKindGuillaume Gomez-8/+2
2022-07-31Remove Clean trait implementation for hir::TypeBindingGuillaume Gomez-7/+9
2022-07-31Remove Clean trait implementation for hir::PathGuillaume Gomez-8/+6
2022-07-30Rollup merge of #99950 - GuillaumeGomez:rm-clean-impls, r=Dylan-DPCMatthias Krüger-38/+30
Remove more Clean trait implementations This time it even allowed to remove a function. Follow-up of https://github.com/rust-lang/rust/pull/99638. r? `@notriddle`
2022-07-30Auto merge of #99948 - Dylan-DPC:rollup-ed5136t, r=Dylan-DPCbors-2/+1
Rollup of 5 pull requests Successful merges: - #99311 (change maybe_body_owned_by to take local def id) - #99862 (Improve type mismatch w/ function signatures) - #99895 (don't call type ascription "cast") - #99900 (remove some manual hash stable impls) - #99903 (Add diagnostic when using public instead of pub) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2022-07-30Remove Clean trait implementation for hir::VariantDataGuillaume Gomez-19/+13
2022-07-30Remove Clean trait implementation for ty::VariantDefGuillaume Gomez-20/+18
2022-07-30Auto merge of #99887 - nnethercote:rm-TreeAndSpacing, r=petrochenkovbors-3/+3
Remove `TreeAndSpacing`. A `TokenStream` contains a `Lrc<Vec<(TokenTree, Spacing)>>`. But this is not quite right. `Spacing` makes sense for `TokenTree::Token`, but does not make sense for `TokenTree::Delimited`, because a `TokenTree::Delimited` cannot be joined with another `TokenTree`. This commit fixes this problem, by adding `Spacing` to `TokenTree::Token`, changing `TokenStream` to contain a `Lrc<Vec<TokenTree>>`, and removing the `TreeAndSpacing` typedef. The commit removes these two impls: - `impl From<TokenTree> for TokenStream` - `impl From<TokenTree> for TreeAndSpacing` These were useful, but also resulted in code with many `.into()` calls that was hard to read, particularly for anyone not highly familiar with the relevant types. This commit makes some other changes to compensate: - `TokenTree::token()` becomes `TokenTree::token_{alone,joint}()`. - `TokenStream::token_{alone,joint}()` are added. - `TokenStream::delimited` is added. This results in things like this: ```rust TokenTree::token(token::Semi, stmt.span).into() ``` changing to this: ```rust TokenStream::token_alone(token::Semi, stmt.span) ``` This makes the type of the result, and its spacing, clearer. These changes also simplifies `Cursor` and `CursorRef`, because they no longer need to distinguish between `next` and `next_with_spacing`. r? `@petrochenkov`
2022-07-29Change maybe_body_owned_by to take local def idMiguel Guarniz-2/+1
Signed-off-by: Miguel Guarniz <mi9uel9@gmail.com>
2022-07-29Statically ensure the size of ItemKindest31-0/+4
2022-07-29Box FunctionItem, TyMethodItem, MethodItem, ForeignFunctionItemest31-12/+12
This reduces ItemKind size from 160 bytes to 112 bytes
2022-07-29Box TypedefItem, ImplItem, AssocTypeItem variants of ItemKindest31-25/+25
This reduces ItemKind size from 224 bytes to 160 bytes.
2022-07-29Remove box syntax from Box<rustdoc::clean::types::ItemKind> constructionest31-4/+4
The type has 240 bytes according to compiler internal rustdoc.
2022-07-29Rollup merge of #99850 - GuillaumeGomez:clean-more-items, r=notriddleYuki Okushi-32/+28
rustdoc: Remove more Clean trait implementations Follow-up of https://github.com/rust-lang/rust/pull/99638. r? `@notriddle`
2022-07-29Remove `TreeAndSpacing`.Nicholas Nethercote-3/+3
A `TokenStream` contains a `Lrc<Vec<(TokenTree, Spacing)>>`. But this is not quite right. `Spacing` makes sense for `TokenTree::Token`, but does not make sense for `TokenTree::Delimited`, because a `TokenTree::Delimited` cannot be joined with another `TokenTree`. This commit fixes this problem, by adding `Spacing` to `TokenTree::Token`, changing `TokenStream` to contain a `Lrc<Vec<TokenTree>>`, and removing the `TreeAndSpacing` typedef. The commit removes these two impls: - `impl From<TokenTree> for TokenStream` - `impl From<TokenTree> for TreeAndSpacing` These were useful, but also resulted in code with many `.into()` calls that was hard to read, particularly for anyone not highly familiar with the relevant types. This commit makes some other changes to compensate: - `TokenTree::token()` becomes `TokenTree::token_{alone,joint}()`. - `TokenStream::token_{alone,joint}()` are added. - `TokenStream::delimited` is added. This results in things like this: ```rust TokenTree::token(token::Semi, stmt.span).into() ``` changing to this: ```rust TokenStream::token_alone(token::Semi, stmt.span) ``` This makes the type of the result, and its spacing, clearer. These changes also simplifies `Cursor` and `CursorRef`, because they no longer need to distinguish between `next` and `next_with_spacing`.
2022-07-28Remove Clean trait implementation for VariantData fieldsGuillaume Gomez-7/+3
2022-07-28Remove Clean trait implementation for VariantStructGuillaume Gomez-7/+8
2022-07-28Remove Clean trait implementation for ty::VisibilityGuillaume Gomez-18/+17
2022-07-27rustdoc: remove Clean trait impl for ty::GenericParamDefMichael Howell-42/+39
2022-07-27rustdoc: remove Clean trait impl for hir::TermMichael Howell-9/+7
2022-07-27rustdoc: remove Clean trait impl for ty::TermMichael Howell-9/+9
2022-07-27Rollup merge of #99783 - notriddle:notriddle/clean-trait-removal, ↵Yuki Okushi-58/+61
r=GuillaumeGomez rustdoc: remove Clean trait impls for more items Follow up to #99638 and #99672
2022-07-27Rollup merge of #99775 - notriddle:notriddle/as-str, r=camelidYuki Okushi-2/+2
rustdoc: do not allocate String when writing path full name No idea if this makes any perf difference, but it just seems like premature pessimisation to use String when str will do.
2022-07-26rustdoc: remove Clean trait impl for ty::PolyTraitPredicateMichael Howell-16/+19
2022-07-26rustdoc: remove Clean trait impls for ty::OutlivesPredicateMichael Howell-29/+27
2022-07-26rustdoc: remove Clean trait impl for ProjectionPredicateMichael Howell-8/+9
2022-07-26rustdoc: remove Clean trait impl for ProjectionTyMichael Howell-9/+10
2022-07-26rustdoc: do not allocate String when writing path full nameMichael Howell-2/+2
No idea if this makes any perf difference, but it just seems like premature pessimisation to use String when str will do.
2022-07-26Rollup merge of #99235 - ↵Matthias Krüger-0/+1
WaffleLapkin:rustdoc_implement_support_for_must_implement, r=GuillaumeGomez rustdoc: Add support for `#[rustc_must_implement_one_of]` This PR adds support for `#[rustc_must_implement_one_of]` attribute added in #92164. There is a desire to eventually use this attribute of `Read`, so making it show up in docs is a good thing. I "stole" the styling from cfg notes, not sure what would be a proper styling. Currently it looks like this: ![2022-07-14_15-00](https://user-images.githubusercontent.com/38225716/178968170-913c1dd5-8875-4a95-9848-b075a0bb8998.png) <details><summary>Code to reproduce</summary> <p> ```rust #![feature(rustc_attrs)] #[rustc_must_implement_one_of(a, b)] pub trait Trait { fn req(); fn a(){ Self::b() } fn b(){ Self::a() } } ``` </p> </details>
2022-07-25rustdoc: avoid inlining modules with duplicate namesMichael Howell-2/+5
Fixes rust-lang/rust#99734
2022-07-24Remove Clean trait implementation for ConstantGuillaume Gomez-26/+27
2022-07-24Remove Clean trait implementation for FieldDefGuillaume Gomez-27/+28
2022-07-24Add support for `#[rustc_must_implement_one_of]` to rustdocMaybe Waffle-0/+1
2022-07-23Remove Clean trait implementation for hir::Ty and middle::TyGuillaume Gomez-136/+153
2022-07-22Auto merge of #99598 - GuillaumeGomez:clean-trait-fields-on-demand, r=notriddlebors-13/+13
Make some clean::Trait fields computation on demand r? `@notriddle`
2022-07-22Make some clean::Trait fields computation on demandGuillaume Gomez-13/+13
2022-07-21Remove unused field in ItemKind::KeywordItemGuillaume Gomez-5/+4
2022-07-19Auto merge of #98180 - notriddle:notriddle/rustdoc-fn, ↵bors-8/+8
r=petrochenkov,GuillaumeGomez Improve the function pointer docs This is #97842 but for function pointers instead of tuples. The concept is basically the same. * Reduce duplicate impls; show `fn (T₁, T₂, …, Tₙ)` and include a sentence saying that there exists up to twelve of them. * Show `Copy` and `Clone`. * Show auto traits like `Send` and `Sync`, and blanket impls like `Any`. https://notriddle.com/notriddle-rustdoc-test/std/primitive.fn.html
2022-07-19Improve the function pointer docsMichael Howell-1/+1
* Reduce duplicate impls; show only the `fn (T)` and include a sentence saying that there exists up to twelve of them. * Show `Copy` and `Clone`. * Show auto traits like `Send` and `Sync`, and blanket impls like `Any`.
2022-07-18Rollup merge of #99344 - ↵Dylan DPC-5/+37
notriddle:notriddle/multiple-macro-rules-w-same-name, r=GuillaumeGomez rustdoc: avoid inlining items with duplicate `(type, name)` Fixes #99221