External Publication
Visit Post

[Pre-Pre RFC] Ability to specify a trait as marker trait

Rust Internals [Unofficial] April 8, 2026
Source

The ability to specify a trait as a marker trait would unlock a lot of new possibilities:

  • Allowing duplicate impls for the trait. The issue with duplicate impl normally is that you can't know which to impl to use, but it doesn't matter in this case, you never pick because there nothing to pick.
    • This can also allow for impl foreign for foreign when the trait and type are from 2 different crates because there won't be any issues if the crates add that impl.
    • Allows creating an or gate on a where block by having a marker trait for it and then implementing the trait for each.
  • Writing marker trait definitions or impl with a semicolon instead (though this doesn't have to be tied to marker traits).
  • Automatic creation of derive macros, and allowing them to be in the same crate as the definition of the type. (Not sure if I think this is a good idea, but thought I'd mention).

Discussion in the ATmosphere

Loading comments...