Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

def_collector: rework trivial const-arg handling #133455

Closed
wants to merge 2 commits into from
Closed

Conversation

lcnr
Copy link
Contributor

@lcnr lcnr commented Nov 25, 2024

see the comment on handle_lazy_anon_const_def

r? @compiler-errors @BoxyUwU

@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 Nov 25, 2024
@BoxyUwU BoxyUwU self-assigned this Nov 25, 2024
@lcnr lcnr force-pushed the uwu2 branch 4 times, most recently from 613056b to 5f05a18 Compare November 25, 2024 14:48
see the comment on `handle_lazy_anon_const_def`
@lcnr lcnr marked this pull request as draft November 25, 2024 15:29
@lcnr lcnr force-pushed the uwu2 branch 2 times, most recently from 51a3ab0 to 2c0df64 Compare November 25, 2024 16:28
@lcnr lcnr marked this pull request as ready for review November 25, 2024 16:28
// See `DefCollector::handle_lazy_anon_const_def` for more details.
//
// FIXME(lcnr): I believe that this shouldn't cause any issues wrt to
// incremental compilation, but am not 100% confident.
let parent_def = self.cx.resolver.invocation_parent(expn_id);
Copy link
Contributor Author

@lcnr lcnr Nov 25, 2024

Choose a reason for hiding this comment

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

an existing concern. would accept this as is for now and handle it in case it is problematic

I looked a bit into ways to make this more resilient but gave up on that for now. If there's any affected code which is not covered by the existing tests, I'll look into this at that point.

@lcnr
Copy link
Contributor Author

lcnr commented Nov 25, 2024

i've looked into an alternative approach for a bit which changes ParentDef to an enum to make sure we handle potentially trivially anon-const everywhere. This ended up being more involved than I thought, see the added comment in the second commit. Given that this PR should be a strict improvement over the status-quo, I would like to merge this as is.

@rust-log-analyzer

This comment has been minimized.

@lcnr
Copy link
Contributor Author

lcnr commented Nov 25, 2024

closing in favor of #133468

@lcnr lcnr closed this Nov 25, 2024
bors added a commit to rust-lang-ci/rust that referenced this pull request Nov 28, 2024
always create `DefId`s for anon consts

but don't use them anywhere, we intentionally don't encode them in the crate metadata.

best reviewed by disabling whitespace.

This pretty much reimplements rust-lang#133285 while adding the tests of rust-lang#133455. Fixes rust-lang#133064

r? `@BoxyUwU` `@compiler-errors`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
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.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants