-
Notifications
You must be signed in to change notification settings - Fork 13k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Remove the unnecessary lang items for Send and Sync #28326
Comments
The lang-items are currently necessary for the following testcase to compile: fn main() {
let _x : Box<Fn()+Send+Sync>;
} |
They are necessary for the following reasons:
These are mostly edge cases (and even if they weren't there we would still be able to do everything), which is why we like to say that Send/Sync could be created in a library with minimal differences. But that doesn't mean they should. |
@Manishearth RE: could vs should, IMO in the long term the caching argument is the only defensible one because that's the only one that can be considered an ignorable implementation detail. We've got this whole OIBIT thing for a reason, let's not count on lang items to shore up language deficiencies forever. (And even if OIBITs are currently unstable, presumably they won't be unstable forever.) |
Ordinary statics are required to be |
Triage: no changes. Tagging with lang and libs, since this would have to be coordinated between the two of them. |
I don't think this is a libs issue; it's really a T-compiler issue, maybe a lang issue. The end result of this issue is that the final public language shouldn't change at all, so the lang part sort of drops out. idk. Now, I guess a holistic solution for these would be to keep Sync a lang item (for statics) and invent a new internal attribute for traits which are allowed to be used in objects. |
#45772 did all we could do here by removing the |
I remember @huonw telling me long ago that these lang items are unnecessary, though I don't remember if there's a good reason for why they haven't been removed yet.
The text was updated successfully, but these errors were encountered: