summary refs log tree commit diff
path: root/src/librustdoc
AgeCommit message (Collapse)AuthorLines
2022-08-15Revert let_chains stabilizationNilstrieb-1/+1
This reverts commit 326646074940222d602f3683d0559088690830f4. It was discovered that they are not implemented correctly, which does not make them ready for stabilization.
2022-08-08Synthetize a trait ref when none is available.Camille GILLOT-6/+12
2022-08-08Avoid ICE in rustdoc.Camille GILLOT-5/+7
2022-08-08rustdoc: do not mark the contents of a skipped module as inlinedMichael Howell-21/+43
2022-08-04remove Clean trait implementation for hir::TraitRefGuillaume Gomez-8/+6
2022-08-04remove Clean trait implementation for hir::FnRetTyGuillaume Gomez-10/+5
2022-08-04Auto merge of #100120 - matthiaskrgr:rollup-g6ycykq, r=matthiaskrgrbors-1/+4
Rollup of 6 pull requests Successful merges: - #98771 (Add support for link-flavor rust-lld for iOS, tvOS and watchOS) - #98835 (relate `closure_substs.parent_substs()` to parent fn in NLL) - #99746 (Use `TraitEngine` in more places that don't specifically need `FulfillmentContext::new_in_snapshot`) - #99786 (Recover from C++ style `enum struct`) - #99795 (Delay a bug when failed to normalize trait ref during specialization) - #100029 (Prevent ICE for `doc_alias` on match arm, statement, expression) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2022-08-03Rollup merge of #100104 - GuillaumeGomez:rm-clean-impls, r=Dylan-DPCMatthias Krüger-42/+34
Remove more Clean trait implementations Follow-up of https://github.com/rust-lang/rust/pull/99638. r? ``@notriddle``
2022-08-03Rollup merge of #100083 - notriddle:notriddle/source-files-js, r=GuillaumeGomezMatthias Krüger-20/+31
rustdoc: use a more compact encoding for source-files.js This reduces the compiler-doc file from 40K to 36K, a 10% reduction in size.
2022-08-03Rollup merge of #98835 - aliemjay:relate_closure_substs, r=nikomatsakisMatthias Krüger-1/+4
relate `closure_substs.parent_substs()` to parent fn in NLL Fixes #98589 The discrepancy between early- and late-bound lifetimes is because we map early-bound lifetimes into those found in the `closure_substs` while late-bound lifetimes are mapped into liberated free regions: https://github.com/rust-lang/rust/blob/5f98537eb7b5f42c246a52c550813c3cff336069/compiler/rustc_borrowck/src/universal_regions.rs#L255-L261 r? `@rust-lang/types`
2022-08-03remove Clean trait implementation for hir::IsAutoGuillaume Gomez-9/+0
2022-08-03remove Clean trait implementation for ty::RegionGuillaume Gomez-33/+34
2022-08-03Rollup merge of #100079 - camelid:fix-doc-star-search, r=Dylan-DPCDylan DPC-1/+1
Replace `* -> vec` with `-> vec` in docs Fixes #100078. Rustdoc's current syntax is `-> vec`.
2022-08-03Rollup merge of #99738 - notriddle:notriddle/multiple-modules-w-same-name, ↵Dylan DPC-7/+12
r=camelid rustdoc: avoid inlining modules with duplicate names Fixes rust-lang/rust#99734
2022-08-02rustdoc: avoid inlining foreigns with duplicate namesMichael Howell-5/+7
2022-08-02Replace `* -> vec` with `-> vec` in docsNoah Lev-1/+1
Rustdoc's current syntax is `-> vec`.
2022-08-02rustdoc: use a more compact encoding for source-files.jsMichael Howell-20/+31
This reduces the compiler-doc file from 40K to 36K, a 10% reduction in size.
2022-08-02Rollup merge of #100057 - GuillaumeGomez:rm-more-clean-impl, r=Dylan-DPCMatthias Krüger-34/+28
Remove more Clean trait implementations Follow-up of https://github.com/rust-lang/rust/pull/99638. r? ``@notriddle``
2022-08-02Rollup merge of #100005 - GuillaumeGomez:cleanup-ast-attr-clean, r=notriddleMatthias Krüger-19/+15
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-19/+15
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-02Rollup merge of #99779 - GuillaumeGomez:fix-item-info-pos-and-height, ↵Matthias Krüger-1/+9
r=notriddle Fix item info pos and height Fixes https://github.com/rust-lang/rust/issues/98266. Fixes https://github.com/rust-lang/rust/issues/98343. You can test it [here](https://rustdoc.crud.net/imperio/fix-item-info-pos-and-height/lib2/trait.Trait.html). Here is a screenshot of the result: ![Screenshot from 2022-07-26 21-55-53](https://user-images.githubusercontent.com/3050060/181100624-18b8b045-5c25-4c7c-9c44-97d55d29b675.png) r? `@jsha`
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-6/+6
2022-08-01Auto merge of #100024 - matthiaskrgr:rollup-36ab4wx, r=matthiaskrgrbors-39/+22
Rollup of 8 pull requests Successful merges: - #99340 (Fix ICE in Definitions::create_def) - #99629 (Improve `cannot move out of` error message) - #99864 (bootstrap: don't emit warn about duplicated deps with same/different features if some of sets actually empty) - #99911 (Remove some uses of `guess_head_span`) - #99976 (Make Rustdoc exit with correct error code when scraping examples from invalid files) - #100003 (Improve size assertions.) - #100012 (Avoid `Ty` to `String` conversions) - #100020 (better error when python is not found in x - issue #99648) Failed merges: - #99994 (Replace `guess_head_span` with `opt_span`) r? `@ghost` `@rustbot` modify labels: rollup
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-01Rollup merge of #99976 - willcrichton:example-analyzer, r=jyn514Matthias Krüger-0/+6
Make Rustdoc exit with correct error code when scraping examples from invalid files This PR fixes a small issue with the new Rustdoc scrape-examples feature. If a file that is being scraped has a type error, then currently that error is printed out, but the rustdoc process exits as if it succeeded. This is a problem for Cargo, which needs to track whether scraping succeeded (see rust-lang/cargo#10343). This PR fixes the issue by checking whether an error is emitted, and aborting if so.
2022-08-01Auto merge of #99884 - nnethercote:lexer-improvements, r=matkladbors-1/+1
Lexer improvements Some cleanups and small speed improvements. r? `@matklad`
2022-08-01Make Rustdoc exit with correct error code when scrape examples from invalid ↵Will Crichton-0/+6
files
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-08-01Shrink `Token`.Nicholas Nethercote-1/+1
From 72 bytes to 12 bytes (on x86-64). There are two parts to this: - Changing various source code offsets from 64-bit to 32-bit. This is not a problem because the rest of rustc also uses 32-bit source code offsets. This means `Token` is no longer `Copy` but this causes no problems. - Removing the `RawStrError` from `LiteralKind`. Raw string literal invalidity is now indicated by a `None` value within `RawStr`/`RawByteStr`, and the new `validate_raw_str` function can be used to re-lex an invalid raw string literal to get the `RawStrError`. There is one very small change in behaviour. Previously, if a raw string literal matched both the `InvalidStarter` and `TooManyHashes` cases, the latter would override the former. This has now changed, because `raw_double_quoted_string` now uses `?` and so returns immediately upon detecting the `InvalidStarter` case. I think this is a slight improvement to report the earlier-detected error, and it explains the change in the `test_too_many_hashes` test. The commit also removes a couple of comments that refer to #77629 and say that the size of these types don't affect performance. These comments are wrong, though the performance effect is small.
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-30Rollup merge of #99873 - ↵Matthias Krüger-1/+9
notriddle:notriddle/invalid-html-tags-webcomponents, r=GuillaumeGomezp rustdoc: align invalid-html-tags lint with commonmark spec
2022-07-30Auto merge of #99948 - Dylan-DPC:rollup-ed5136t, r=Dylan-DPCbors-5/+3
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-30Update src/librustdoc/passes/html_tags.rsMichael Howell-1/+1
Co-authored-by: Guillaume Gomez <guillaume1.gomez@gmail.com>
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-30Rollup merge of #99311 - kckeiks:clean-up-body-owner-methods, r=cjgillotDylan DPC-5/+3
change maybe_body_owned_by to take local def id Issue https://github.com/rust-lang/rust/issues/96341 r? `@cjgillot`
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-30Rollup merge of #99904 - GuillaumeGomez:cleanup-html-whitespace, r=notriddleYuki Okushi-19/+21
Cleanup html whitespace I realized while looking at the raw HTML that we generated some unwanted white space characters. This PR cleans up the one coming directly from rustdoc. I'll check from `pulldown-cmark` for the remaining ones. Some numbers now: the difference is small, it goes from `63009` to `62859`. But multiplied by the number of files, it becomes quite interesting overall. r? `@notriddle`
2022-07-29Change maybe_body_owned_by to take local def idMiguel Guarniz-5/+3
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-16/+16
This reduces ItemKind size from 160 bytes to 112 bytes
2022-07-29Box TypedefItem, ImplItem, AssocTypeItem variants of ItemKindest31-37/+37
This reduces ItemKind size from 224 bytes to 160 bytes.