-
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
Make Rc and Arc #[fundamental] #56955
Conversation
This comment has been minimized.
This comment has been minimized.
As a baseline I'd want to be sure to run crater to see what happen, hopefully that breakage is just limited to specialization! |
If I understand https://github.com/rust-lang/rfcs/blob/master/text/1023-rebalancing-coherence.md#errors-from-cargo-and-the-fundamental-attribute correctly, this means that we can never extend the set of traits implemented for
(The above is for Does this also affect more specific impls, like for |
I believe that is correct. Someone may have a I wonder: @cramertj, do you have specific examples of impls you wanted to write but couldn't? Maybe there is a more limited formulation of |
I do tend to agree with @cramertj that it is hard to justify a discrepancy beween |
They're basically all of the form |
This comment has been minimized.
This comment has been minimized.
@bors: try |
Make Rc and Arc #[fundamental] Fixes #24317. r? @alexcrichton and @rust-lang/libs
☀️ Test successful - status-travis |
@craterbot run start=master#d99a320cba42f661aebfa1293b7b2ec3603dda75 end=try#e70472fc501b855c9080f3772432c10fe20b8866 mode=check-only |
👌 Experiment ℹ️ Crater is a tool to run experiments across parts of the Rust ecosystem. Learn more |
🚧 Experiment ℹ️ Crater is a tool to run experiments across parts of the Rust ecosystem. Learn more |
🎉 Experiment
|
Spot checking a few of those they look legitimate, unless that's a compiler but I don't think we can do this change :( |
Ugh. Previously, we allowed negative reasoning that relied on example of error:
|
I vaguely remember this situation in tokio-service, but I don't remember the exact details. Maybe there's an alternative fundamental-like rule that makes this work? |
It's actually incoherent if a user can write |
@cramertj correct, but what about a variant of fundamental that doesnt include impls of fundamental traits? so users just cant impl the fn traits for arcs and rcs, which is probably fine since you cant implement those traits on stable anyway and the established pattern is to write these blanket impls instead since I don't think any fundamental traits are stable to implement its possible we could just change the meaning of the fundamental attribute in this way without breaking any stable code.. |
Yeah, we could introduce |
That would make it a breaking change to add the fundamental attribute to any existing trait, though! Not sure what the next step in the process should be, since some change along these lines would be necessary before moving forward with this PR. |
Adding |
I feel like maybe the answer is that we should think about designing a "better solution" to the fundamental problem -- or perhaps it's best to broaden the scope a bit to coherence more generally. (I would also not be surprised to learn that adding fundamental to existing traits may be breaking, at least in the absence of new features.) In general, I feel like there is a need to be able to "publicly affirm" that certain impls will never be added. For example, I'd like to be able to declare definitely that (But of course this leaves open the question of how to say things like " I feel like as we move towards Chalk, we have the tools in place to talk carefully about these questions (e.g., we now have a model of coherence in Chalk and it was kind of illuminating). But it's not a small design challenge :( and maybe it is not sufficient priority to think about. |
ping from triage @cramertj @alexcrichton @nikomatsakis any updates on this? |
This can't make progress unless we also change how fundamental types work in some way. With the current fundamental semantics, this PR is a breaking change. |
@withoutboats thanks. Marking this as blocked. |
I'm going to just close this PR. Feel free to re-open @cramertj if you think there's value in having it open. |
Nah, closing is fine-- I'll just continue to sulk, but more quietly now, knowing that there's a reason we can't have nice things ;) |
Fixes #24317.
r? @alexcrichton
and @rust-lang/libs