about summary refs log tree commit diff
path: root/src/librustdoc
AgeCommit message (Collapse)AuthorLines
2024-12-15Add hir::AttributeJonathan Dönszelmann-54/+52
2024-12-15Rollup merge of #134285 - oli-obk:push-vwrqsqlwnuxo, r=UrgauStuart Cook-12/+7
Add some convenience helper methods on `hir::Safety` Makes a lot of call sites simpler and should make any refactorings needed for https://github.com/rust-lang/rust/pull/134090#issuecomment-2541332415 simpler, as fewer sites have to be touched in case we end up storing some information in the variants of `hir::Safety`
2024-12-14Add some convenience helper methods on `hir::Safety`Oli Scherer-12/+7
2024-12-14Remove the parse querybjorn3-65/+53
2024-12-14Get rid of of the global_ctxt querybjorn3-19/+22
2024-12-14Auto merge of #134185 - compiler-errors:impl-trait-in-bindings, r=oli-obkbors-2/+6
(Re-)Implement `impl_trait_in_bindings` This reimplements the `impl_trait_in_bindings` feature for local bindings. "`impl Trait` in bindings" serve as a form of *trait* ascription, where the type basically functions as an infer var but additionally registering the `impl Trait`'s trait bounds for the infer type. These trait bounds can be used to enforce that predicates hold, and can guide inference (e.g. for closure signature inference): ```rust let _: impl Fn(&u8) -> &u8 = |x| x; ``` They are implemented as an additional set of bounds that are registered when the type is lowered during typeck, and then these bounds are tied to a given `CanonicalUserTypeAscription` for borrowck. We enforce these `CanonicalUserTypeAscription` bounds during borrowck to make sure that the `impl Trait` types are sensitive to lifetimes: ```rust trait Static: 'static {} impl<T> Static for T where T: 'static {} let local = 1; let x: impl Static = &local; //~^ ERROR `local` does not live long enough ``` r? oli-obk cc #63065 --- Why can't we just use TAIT inference or something? Well, TAITs in bodies have the problem that they cannot reference lifetimes local to a body. For example: ```rust type TAIT = impl Display; let local = 0; let x: TAIT = &local; //~^ ERROR `local` does not live long enough ``` That's because TAITs requires us to do *opaque type inference* which is pretty strict, since we need to remap all of the lifetimes of the hidden type to universal regions. This is simply not possible here. --- I consider this part of the "impl trait everywhere" experiment. I'm not certain if this needs yet another lang team experiment.
2024-12-14(Re-)Implement impl_trait_in_bindingsMichael Goulet-2/+6
2024-12-14Rollup merge of #134251 - bjorn3:various_cleanups2, r=oli-obkMatthias Krüger-1/+3
A bunch of cleanups (part 2) Just like https://github.com/rust-lang/rust/pull/133567 these were all found while looking at the respective code, but are not blocking any other changes I want to make in the short term.
2024-12-14Rollup merge of #134231 - notriddle:notriddle/mismatched-path, r=GuillaumeGomezMatthias Krüger-0/+8
rustdoc-search: fix mismatched path when parent re-exported twice
2024-12-13rustdoc-search: show `impl Trait` inline when unhighlightedMichael Howell-1/+6
While normal generics can be skipped in this case, no-names need something to show here. Before: `TyCtxt, , Symbol -> bool` After: `TyCtxt, Into<DefId>, Symbol -> bool`
2024-12-13Rollup merge of #134140 - compiler-errors:unsafe-binders-ast, r=oli-obkMatthias Krüger-0/+3
Add AST support for unsafe binders I'm splitting up #130514 into pieces. It's impossible for me to keep up with a huge PR like that. I'll land type system support for this next, probably w/o MIR lowering, which will come later. r? `@oli-obk` cc `@BoxyUwU` and `@lcnr` who also may want to look at this, though this PR doesn't do too much yet
2024-12-13Correctly handle comments in attributes in doctests source codeGuillaume Gomez-0/+2
2024-12-13Remove registered_lints field from Sessionbjorn3-1/+3
It only exists to pass some information from one part of the driver to another part. We can directly pass this information to the function that needs it to reduce the amount of mutation of the Session.
2024-12-12rustdoc-search: fix mismatched path when parent re-exported twiceMichael Howell-0/+8
2024-12-12Rollup merge of #134214 - klensy:rd-shadow, r=notriddleMatthias Krüger-1/+1
rustdoc: fix self cmp Looks like condition in `filter` currently always `true`, but intended to compare with `fqp` from `if let Some(&(ref fqp, item_type))`?
2024-12-12Fix toolsMichael Goulet-0/+3
2024-12-12Rename `handle_call` into `infer_id`Guillaume Gomez-4/+4
2024-12-12fix self shadowed self compareklensy-1/+1
2024-12-12Enable "jump to def" feature on patternsGuillaume Gomez-1/+26
2024-12-12Enable "jump to def" feature on prelude variantsGuillaume Gomez-5/+10
2024-12-10Remove more traces of anonymous ADTsMichael Goulet-3/+0
2024-12-09Rollup merge of #133567 - bjorn3:various_cleanups, r=cjgillotMatthias Krüger-49/+33
A bunch of cleanups These are all extracted from a branch I have to get rid of driver queries. Most of the commits are not directly necessary for this, but were found in the process of implementing the removal of driver queries. Previous PR: https://github.com/rust-lang/rust/pull/132410
2024-12-06Remove all threading through of ErrorGuaranteed from the driverbjorn3-48/+31
It was inconsistently done (sometimes even within a single function) and most of the rest of the compiler uses fatal errors instead, which need to be caught using catch_with_exit_code anyway. Using fatal errors instead of ErrorGuaranteed everywhere in the driver simplifies things a bit.
2024-12-06Store a single copy of the error registry in DiagCtxtbjorn3-1/+2
And pass this to the individual emitters when necessary.
2024-12-06remove eq for attributesJonathan Dönszelmann-13/+0
2024-12-05Improve positioning of "..." in collapsed impl blockGuillaume Gomez-3/+8
2024-12-05Use text ellipsis instead of bottom blurringGuillaume Gomez-11/+16
2024-12-05Turn `markdown_split_summary_and_content` into a method of `Markdown`Guillaume Gomez-49/+52
2024-12-05Always display first line of impl blocks even when collapsedGuillaume Gomez-47/+141
2024-12-04Rollup merge of #133804 - GuillaumeGomez:improve-code, r=notriddleMatthias Krüger-28/+22
Improve code for FileName retrieval in rustdoc Some calls were performed twice (first in `is_real_and_local` and then in the function calling it). Also the `FileName` was matched on a few times too. r? `@notriddle`
2024-12-04Rollup merge of #133764 - aDotInTheVoid:rename, r=GuillaumeGomezMatthias Krüger-18/+18
rustdoc: Rename `set_back_info` to `restore_module_data`. Follow-up to #133345, r? `@GuillaumeGomez` Most of the references to `info` got removed as it was clear that `module_data` makes more sense here. Makes it clearer that `save_module_data` and `restore_module_data` are a pair.
2024-12-03Rename `is_real_and_local` function into `filename_real_and_local`Guillaume Gomez-3/+4
2024-12-03Improve code for FileName retrieval in rustdocGuillaume Gomez-28/+21
2024-12-03switch jemalloc-sys back to tikv-jemalloc-sys, and update to 0.6.0Rémy Rakic-1/+1
2024-12-02Rollup merge of #133746 - oli-obk:push-xwyrylxmrtvq, r=jieyouxuGuillaume Gomez-1/+1
Change `AttrArgs::Eq` to a struct variant Cleanups for simplifying https://github.com/rust-lang/rust/pull/131808 Basically changes `AttrArgs::Eq` to a struct variant and then avoids several matches on `AttrArgsEq` in favor of methods on it. This will make future refactorings simpler, as they can either keep methods or switch to field accesses without having to restructure code
2024-12-02rustdoc: Rename set_back_info to restore_module_data.Alona Enraght-Moony-18/+18
2024-12-02Rollup merge of #133745 - GuillaumeGomez:default-ids-match, r=notriddleGuillaume Gomez-60/+56
Remove static HashSet for default IDs list Follow-up of https://github.com/rust-lang/rust/pull/133345. Let's see how it impacts performance. r? `@notriddle`
2024-12-02Rollup merge of #133715 - aDotInTheVoid:rdj-static, r=GuillaumeGomezGuillaume Gomez-13/+16
rustdoc-json: Include safety of `static`s `static`s in an `extern` block can have an associated safety annotation ["because there is nothing guaranteeing that the bit pattern at the static’s memory is valid for the type it is declared with"](https://doc.rust-lang.org/reference/items/external-blocks.html#statics). Rustdoc already knows this and displays in for HTML. This PR also includes it in JSON. Inspired by https://github.com/obi1kenobi/cargo-semver-checks/issues/975 which needs this, but it's probably useful in other places. r? `@GuillaumeGomez.` Possibly easier to review commit-by-commit.
2024-12-02Remove static HashSet for default IDs listGuillaume Gomez-60/+56
2024-12-02Change `AttrArgs::Eq` into a struct variantOli Scherer-1/+1
2024-12-01Rollup merge of #133589 - voidc:remove-array-len, r=boxyuwuJacob Pratt-22/+25
Remove `hir::ArrayLen` This refactoring removes `hir::ArrayLen`, replacing it with `hir::ConstArg`. To represent inferred array lengths (previously `hir::ArrayLen::Infer`), a new variant `ConstArgKind::Infer` is added. r? `@BoxyUwU`
2024-12-01Auto merge of #133345 - GuillaumeGomez:stop-cloning-context, ↵bors-285/+355
r=notriddle,aDotInTheVoid Stop cloning `Context` so much This is a first step for https://github.com/rust-lang/rust/issues/82381. It's already big enough so I'll continue in a follow-up once this PR is merged. Next step will be to get rid of `SharedContext` by inlining it directly into `Context`. cc `@camelid` r? `@notriddle`
2024-12-01rustdoc-json: Include safety of `static`sAlona Enraght-Moony-13/+16
2024-12-01Fix link to `FormatRenderer` methodGuillaume Gomez-1/+1
2024-12-01Rename `FormatRenderer::InfoType` into `ModuleData` and rename ↵Guillaume Gomez-13/+13
`FormatRenderer::make_child_renderer` into `save_module_data`
2024-12-01Add `unreachable!` in new `FormatRenderer` methods for `JsonRenderer` ↵Guillaume Gomez-2/+7
implementation
2024-12-01Add documentation for new `FormatRenderer` trait itemsGuillaume Gomez-2/+30
2024-12-01Move `SharedContext` out of `Rc`Guillaume Gomez-162/+171
2024-12-01Store default ID map in a staticGuillaume Gomez-3/+7
2024-12-01Split ID maps in two parts: the constant one and the updated oneGuillaume Gomez-67/+57