Rollup of 6 pull requests#156140
Closed
jhpratt wants to merge 17 commits intorust-lang:mainfrom
Closed
Conversation
Co-authored-by: León Orell Valerian Liehr <me@fmease.dev>
…nabled, not when `needs_crate_hash` is true. Exactly as the comment on the `crate_hash` field of `Linker` says, that field is only used when incremental compilation is enabled. `needs_crate_hash` returns true in some other cases too.
It's easy to confuse the functionality of `needs_crate_hash` with "is the crate_hash query needed" right now. The function returns whether we need to calculate the stable hash of various hir structs.
`trait_info_of` already returns `None` for unsized types, so allowing `T: ?Sized` is sound and lets callers in generic contexts use these functions without a separate `Sized` bound. For unsized `T`, the function always returns `None`.
So that commits under different names are still caught
Just gating `...` is insufficient because we make the types available everywhere, and you could still define and export functions that used va_arg for targets where we don't want to stably support it.
…ures, r=BoxyUwU docs(unstable-book): Document const generics features Relevant tracking issues: rust-lang#113521 rust-lang#132980 rust-lang#76560 rust-lang#151972 ## What Adds a high-level overview of 4 unstable features related to const generic exprs. ## Why While trying to learn about the current state of const generic exprs, I found it a bit too hard due to lack of documentation -- had to read through a bunch of tracking issues & look for PRs/examples in the repo just to understand what the feature is about. Moreover, given that there is a bunch of features with similarly-looking names, it was even more confusing. For that purpose, I also added cross-referencing across (directly or logically) related features. As a result, I decided to add some more context to the unstable book, so that new readers have an easier time than I had. ## Caveats I understand that the features are incomplete/experimental, so the docs are at risk of becoming stale, but the book entrypoint already has [a corresponding warning](https://doc.rust-lang.org/unstable-book/), so I guess it should be fine. Also, given that I did research myself, the examples provided might be not the best to showcase the feature -- happy to provide better examples, if you have suggestions. The examples provided are what "made the feature make sense" to me as an outsider, so there is a chance that they will be good for other external readers too, though. LLM use disclosue: an LLM was used for self-review only; research, coming up with examples, and writing is mine. Issues reported by LLM were fixed manually too. r? @BoxyUwU
…-test, r=joshtriplett c-variadic: gate `va_arg` on `c_variadic_experimental_arch` tracking issue: rust-lang#44930 Just gating `...` is insufficient because we make the types available everywhere, and you could still define and export functions that used va_arg for targets where we don't want to stably support it. r? joshtriplett
…ted-types, r=petrochenkov Move tests associated types Hi, I have moved some ui tests I feel belong in the associated types folder
…nkov Clean up `TyCtxt::needs_crate_hash` usage and rename it to `needs_hir_hash`. While reviewing `crate_hash` query usage for rust-lang#155871, the `needs_crate_hash` function turned out to be the cause of unnecessary calls to the query. The `needs_crate_hash` name is easy to mistake for the functionality of "needs the crate_hash query". This PR removes the usage of `needs_crate_hash` where it was not appropriate and renames the function to `needs_hir_hash` which better reflects its functionality.
…-obk Relax `T: Sized` bound on `try_as_dyn` / `try_as_dyn_mut` `trait_info_of` already returns `None` for unsized types, so allowing `T: ?Sized` is sound and lets callers in generic contexts use these functions without a separate `Sized` bound. For unsized `T`, the function always returns `None`. Tracking issue: rust-lang#144361 ## Motivation Currently, it is not possible to use `try_as_dyn` as "specialization-like" dispatch in blanket impls with `?Sized` type. ```rust // Cannot add ?Sized now. impl<T: 'static /* + ?Sized */, S: Serializer + 'static> Serialize<S> for T { fn serialize(&self, serializer: &mut S) -> Result<S::Ok, S::Error> { if let Some(spec) = try_as_dyn::<_, dyn SpecializedSer<S>>(self) { spec.specialized_serialize(serializer) } else { // fall back to compile-time reflection via TypeId ... } } } ```
…laumeGomez .mailmap: prefer matching just based on commit emails So that commits under different names are still caught
Member
Author
|
@bors r+ rollup=never p=5 |
Contributor
This comment has been minimized.
This comment has been minimized.
rust-bors Bot
pushed a commit
that referenced
this pull request
May 4, 2026
Rollup of 6 pull requests Successful merges: - #155543 (docs(unstable-book): Document const generics features) - #156043 (c-variadic: gate `va_arg` on `c_variadic_experimental_arch`) - #156082 (Move tests associated types) - #156092 (Clean up `TyCtxt::needs_crate_hash` usage and rename it to `needs_hir_hash`.) - #156104 (Relax `T: Sized` bound on `try_as_dyn` / `try_as_dyn_mut`) - #156128 (.mailmap: prefer matching just based on commit emails)
Collaborator
|
The job Click to see the possible cause of the failure (guessed by this bot) |
Contributor
|
💔 Test for 2c0b32a failed: CI. Failed job:
|
Contributor
|
Spurious |
Contributor
|
This pull request was unapproved due to being closed. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Successful merges:
va_argonc_variadic_experimental_arch#156043 (c-variadic: gateva_argonc_variadic_experimental_arch)TyCtxt::needs_crate_hashusage and rename it toneeds_hir_hash. #156092 (Clean upTyCtxt::needs_crate_hashusage and rename it toneeds_hir_hash.)T: Sizedbound ontry_as_dyn/try_as_dyn_mut#156104 (RelaxT: Sizedbound ontry_as_dyn/try_as_dyn_mut)r? @ghost
Create a similar rollup