No. Rust doesn't have runtime type information, and the type information it does have at compile time can't be accessed in any way from your code.
More edits: OK, OK... I mean, you can introspect types, but that requires a lint, which is a compiler plugin, which means the interface is effectively unsupported and changes on a regular basis. Also, lints can't generate code, so you'd have to pull some TeX shenanigans to use that information.
What you could do is write a custom derive that you add to each type that implements X, and write those out to a file, which you then re-import on the next compile to generate all_x... but again, yuck.
Or, if you're super desperate, you could use syn in a build script to parse your source code, find all the implementations of X (keeping in mind that you don't have access to name or type resolution), and generate all_xthat way.
Hmm. It would be fine to repeat the list of types I want to be visited in this way, though.
I actually need a number of different methods that'll visit all the relevant types in this way, and what I want to achieve is not to have to repeat the same list over and over again.
Thank you very much for your quick and competent help! I like this idea. If I may, I'll use your code as building blocks for a bigger macro that'll generate all the necessary methods.