-
Notifications
You must be signed in to change notification settings - Fork 12.8k
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
libs: make TypeId opaque #18104
Comments
cc @chris-morgan, this would adversely affect |
cc @thestinger |
cc me I would be very sad if this happened, as As a data point, note that and several other libraries that I have authored (mostly through uses of typemap). A better situation would probably be to have |
@aturon: There are still going to be ABI stability hazards because code can use |
@thestinger To clarify, if |
@reem Yes, very much understood. There will definitely be some way to do downcasting, but we're trying to minimize the machinery that has to be exposed for that to work. On the other hand, typemap seems to rely crucially on identity, not just downcasting. I'd love to hear more about how it's used, and whether there might be any other way to solve the problem. We definitely want to make sure your use-cases are addressed! I'm not sure that just adding bounds restricting the generation of |
@aturon: It basically enforces that messing around with internals of types in any way == ABI change. If a application puts a type from a library in |
@thestinger OK, I understand, and am going to close this issue since:
That said, it would be helpful to understand more concretely whether the Also, FWIW any proposal to replace these mechanisms should take into account the use-cases that @reem and @chris-morgan have. If you do have an alternative proposal in mind, it would be great to see an RFC. |
…eykril minor: Stricter requirements for package wide flycheck Require the existence of a target and `check_workspace` to be false to restart package-wide flycheck. Fixes rust-lang#18194 , rust-lang#18104
Currently,
std::intrinsics::TypeId
exposes equality testing and hashing, and theAny
trait allows you to get aTypeId
for any'static
data. Previously,Any
hid these capabilities through a private supertrait, but changed to privacy rules have made that impossible.We should consider exposing equality and hashing on
TypeId
only through a private, internal trait used byAny
. This should mitigate ABI stability hazards.The text was updated successfully, but these errors were encountered: