Skip to content

Conversation

RalfJung
Copy link
Member

@RalfJung RalfJung commented Oct 9, 2025

Determining whether a type is a 1-ZST will internally do full normalization, so we better do the same when scanning for non-exhaustive types.

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 Oct 9, 2025
// "known" respecting #[non_exhaustive] attributes.
let field_infos = adt.all_fields().map(|field| {
let ty = field.ty(tcx, GenericArgs::identity_for_item(tcx, field.did));
let typing_env = ty::TypingEnv::non_body_analysis(tcx, field.did);
Copy link
Member Author

Choose a reason for hiding this comment

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

Previously we used the field DefId here, now we're using the DefId of the surrounding ADT -- I hope that doesn't make a difference.

@lcnr
Copy link
Contributor

lcnr commented Oct 13, 2025

@bors r+ rollup

using the TypingEnv for the adt doesn't matter and may even be slightly faster in theory 🤷

@bors
Copy link
Collaborator

bors commented Oct 13, 2025

📌 Commit 3452415 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-review Status: Awaiting review from the assignee but also interested parties. labels Oct 13, 2025
GuillaumeGomez added a commit to GuillaumeGomez/rust that referenced this pull request Oct 13, 2025
…-normalize, r=lcnr

repr_transparent_external_private_fields: normalize types during traversal

Determining whether a type is a 1-ZST will internally do full normalization, so we better do the same when scanning for non-exhaustive types.

r? `@lcnr`
bors added a commit that referenced this pull request Oct 13, 2025
Rollup of 6 pull requests

Successful merges:

 - #147514 (repr_transparent_external_private_fields: normalize types during traversal)
 - #147605 (Add doc links between `{integer}::from_str_radix` and `from_str`)
 - #147608 (cg_llvm: Use `LLVMDIBuilderCreateGlobalVariableExpression`)
 - #147623 (Clear `ChunkedBitSet` without reallocating)
 - #147625 (Add a warning when running tests with the GCC backend and debug assertions are enabled)
 - #147626 (Generalize configuring LLD as the default linker in bootstrap)

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors merged commit 4a7e152 into rust-lang:master Oct 13, 2025
10 checks passed
@rustbot rustbot added this to the 1.92.0 milestone Oct 13, 2025
rust-timer added a commit that referenced this pull request Oct 13, 2025
Rollup merge of #147514 - RalfJung:transparent-nonexhaustive-normalize, r=lcnr

repr_transparent_external_private_fields: normalize types during traversal

Determining whether a type is a 1-ZST will internally do full normalization, so we better do the same when scanning for non-exhaustive types.

r? ``@lcnr``
@RalfJung RalfJung deleted the transparent-nonexhaustive-normalize branch October 15, 2025 06:43
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.

4 participants