Skip to content

Conversation

@BoxyUwU
Copy link
Member

@BoxyUwU BoxyUwU commented Dec 18, 2025

title

r? lcnr

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Dec 18, 2025
let identity_args = GenericArgs::identity_for_item(tcx, typeck_root_def_id);
if self.mir_def.to_def_id() == typeck_root_def_id
// Do not ICE when checking default_field_values consts with lifetimes (#135649)
&& DefKind::Field != tcx.def_kind(tcx.parent(typeck_root_def_id))
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was erroneously added in #135711 to work around the fact that generics_of for default field values was wrong (None parent) resulting in identity_args being empty. It was then fixed properly in #137913 with neither errs or myself realising this logic existed so this can just be removed now

let arg_mapping = iter::zip(identity_args.regions(), fr_args.regions().map(|r| r.as_var()));
// This relies on typeck roots being generics_of parents with their
// parameters at the start of nested bodies' generics.
assert!(renumbered_args.len() >= identity_args.len());
Copy link
Member Author

@BoxyUwU BoxyUwU Dec 18, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't know how valuable this assert is in practice? I also would expect us to be relying on this invariant in more places in the compiler than just here 🤔 feels like more generally we expect all typeck parents to be generics_of parents and if that doesn't hold we probably want to yell somewhere other than here 🤔


mod opaque;

fn anon_const_type_of<'tcx>(icx: &ItemCtxt<'tcx>, def_id: LocalDefId) -> Ty<'tcx> {
Copy link
Member Author

@BoxyUwU BoxyUwU Dec 18, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ive just moved this down because it's weird for type_of to be sandwiched between helper functions both on top and below :3 no actual changes here

@rust-log-analyzer

This comment has been minimized.

Copy link
Contributor

@lcnr lcnr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@lcnr lcnr added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Dec 20, 2025
@BoxyUwU
Copy link
Member Author

BoxyUwU commented Dec 24, 2025

@bors r=lcnr rollup

@bors
Copy link
Collaborator

bors commented Dec 24, 2025

📌 Commit 0e0911b has been approved by lcnr

It is now in the queue for this repository.

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Dec 24, 2025
JonathanBrouwer added a commit to JonathanBrouwer/rust that referenced this pull request Dec 24, 2025
Misc cleanups from reading some borrowck code

title

r? lcnr
bors added a commit that referenced this pull request Dec 24, 2025
…uwer

Rollup of 3 pull requests

Successful merges:

 - #150141 (Misc cleanups from reading some borrowck code)
 - #150297 (Fix compile issue in Vita libstd)
 - #150341 (Fix some divergences with the cg_clif subtree)

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors merged commit c772ca3 into rust-lang:main Dec 24, 2025
11 checks passed
@rustbot rustbot added this to the 1.94.0 milestone Dec 24, 2025
rust-timer added a commit that referenced this pull request Dec 24, 2025
Rollup merge of #150141 - BoxyUwU:borrowck_cleanup_1, r=lcnr

Misc cleanups from reading some borrowck code

title

r? lcnr
@bors
Copy link
Collaborator

bors commented Dec 24, 2025

⌛ Testing commit 0e0911b with merge e7d4414...

@BoxyUwU
Copy link
Member Author

BoxyUwU commented Dec 24, 2025

@bors r- retry

?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants