I don't think this is possible in its full generality. What do you do with tuples of identical field types? How do you deal with generics, where the concrete types are not known, and as such, they may be identical or distinct? I see that this has all the problems "union types" (that also come up periodically) have, for similar reasons.
I had suspected as much, I think generally it's possible to define rules to resolve the ambiguities you describe but it doesn't seem like expressing the concept is possible in the language as is.
To constrain the problem, and possibly make it tractable; what if I only wanted to retain all the elements of some specified types in a tuple? Something like:
It’s technically possible if you restrict the valid field types to a known subset and pull some really complicated trait shenanigans, but those have a tendency to bring the compiler to its knees for anything nontrivial. For any real application, you’ll be better off writing all of the necessary trait implementations explicitly (via macro). Or even better, accept the tiny amount of runtime cost to deal with a dyn- or enum-based solution.