Rollup of 4 pull requests - #160419
Closed
JonathanBrouwer wants to merge 11 commits into
Closed
Conversation
* fix borrowck ICE for consts with fn pointer type annotate_argument_and_return_for_borrow called tcx.fn_sig on the item being checked whenever its type was FnDef or FnPtr. for a const whose type is a fn pointer that's not a function item, so we ICE'd with "unexpected sort of node in fn_sig". take the signature from the fn ptr type instead and skip the annotation when there's no fn decl. * run rustfmt and refmt * fix borrowck ICE for consts with fn pointer type annotate_argument_and_return_for_borrow called tcx.fn_sig on the item being checked whenever its type was FnDef or FnPtr. for a const whose type is a fn pointer that's not a function item, so we ICE'd with "unexpected sort of node in fn_sig". take the signature from the fn ptr type instead and skip the annotation when there's no fn decl. * edit comment * use ty.fn_sig per review
This commit changes `DEP_KIND_NUM_VARIANTS` so it's an associated const (renamed as `DepKind::NUM_VARIANTS`) obtained via `std::mem::variant_count`, removing the paranoid consecutiveness check. The commit also replaces multiple `DepKind::MAX as usize + 1` occurrences with `DepKind::NUM_VARIANTS`.
It contains pre-stringified versions of all the `DepKind` variants. But
we can just stringify on demand using `format!("{:?}")`.
Co-authored-by: Jakub Beránek <berykubik@gmail.com>
…lathar `DepKind` cleanups Details in individual commits. r? Zalathar
…efault-parent, r=nnethercote Fix ICE for direct inline const generic defaults Fixes rust-lang#159063 This pr is for using the defaulted const parameter's parent to find the generics containing the parameter, instead of using the queried anonymous const's parent.
fix borrowck ICE for consts with fn pointer type `borrowck`'s `annotate_argument_and_return_for_borrow` called `tcx.fn_sig` on the item being checked whenever its type was a `fn def` or `fn ptr`. For a const like `const A: fn()`, that asks for the signature of the const itself, which is not a function item, so we ICE'd with `"unexpected sort of node in fn_sig"`. Now we take the signature from the `fn ptr` type instead and skip the annotation when there's no `fn decl` to annotate. also added a regression test under `tests/ui/borrowck`. fixes: rust-lang#160255
…, r=Kobzol Add PR body notes for Cargo lock file maintenance r? @Kobzol
Contributor
Author
Contributor
Contributor
|
⌛ Trying commit f15b2ab with merge dcaa7d8… To cancel the try build, run the command Workflow: https://github.com/rust-lang/rust/actions/runs/30796488271 |
rust-bors Bot
pushed a commit
that referenced
this pull request
Aug 3, 2026
Rollup of 4 pull requests try-job: dist-various-1 try-job: test-various try-job: x86_64-gnu-aux try-job: x86_64-gnu-llvm-21-3 try-job: x86_64-msvc-1 try-job: aarch64-apple try-job: x86_64-mingw-1 try-job: i686-msvc-*
Contributor
Author
|
@bors try cancel |
Contributor
|
This pull request was unapproved due to being closed. |
Contributor
|
Try build cancelled. Cancelled workflows: |
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:
DepKindcleanups #160406 (DepKindcleanups)r? @ghost
Create a similar rollup