Skip to content

Conversation

@Jamesbarford
Copy link
Contributor

@Jamesbarford Jamesbarford commented Nov 19, 2025

This feels a bit odd checking for "0" but I can't see how else to check for it being a Tuple

closes #148919

@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 19, 2025
@rustbot
Copy link
Collaborator

rustbot commented Nov 19, 2025

r? @JonathanBrouwer

rustbot has assigned @JonathanBrouwer.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

}
}

fn has_tuple_fields(&mut self, def_id: DefId) -> bool {
Copy link
Member

Choose a reason for hiding this comment

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

I'm relatively sure the proper way to check if a definition is a tuple struct is something like:

let adt_def = tcx.adt_def(def_id);
adt_def.is_struct() && adt_def.non_enum_variant().ctor_kind() == Some(CtorKind::Fn)

No guarantees.

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.

“cannot initialize a tuple struct which contains private fields” with no tuple struct involved

4 participants