Hacker News new | ask | show | jobs
by saturn_vk 107 days ago
So, like https://doc.rust-lang.org/std/marker/index.html?
1 comments

Those are integrated in the compiler and don't need a second tool to work.

Also, AFAIK, they only leverage standard language behaviour and are not a hardcoded special case.

Nearly everything in that module relies on at least some hardcoded compiler magic (what Rust calls "language items", with a `#[lang = "..."]` attribute on the definition). The only exception is `Send`—and even that is still an auto trait, which on stable Rust can only be defined by the standard library. (There are plans to also remove the lang-item status from `Unpin`.)
Fair point, I was only looking at the structs, not the traits.