Skip to content
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 fundamental traits #3

Open
nikomatsakis opened this issue Mar 24, 2022 · 1 comment
Open

Remove fundamental traits #3

nikomatsakis opened this issue Mar 24, 2022 · 1 comment
Assignees
Labels
enhancement New feature or request

Comments

@nikomatsakis
Copy link
Contributor

Motivation

In RFC 1023, we introduced the idea of fundamental traits. The primary motivation here, if I recall, was that there were some APIs which wished to take either a closure or a concrete value. Therefore, the #[fundamental] annotation was added to the Fn traits -- and I think no others? (We should check.) This attribute allowed coherence to "cheat" with respect to the closure traits and determine that they were not implemented.

We may be stuck with this mechanism forever, since there can definitely be user-space code that relies on. But we also may not: we could potentially remove #[fundamental] traits and introduce instead explicit negative impls for the other legal values that can be supplied to such functions.

Details

We should try removing fundamental, introducing the appropriate negative impls, and doing a crater run!

@nikomatsakis nikomatsakis added the enhancement New feature or request label Mar 24, 2022
@spastorino
Copy link
Member

More info rust-lang/lang-team#96 (comment)

@spastorino spastorino self-assigned this Mar 25, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants