-
Notifications
You must be signed in to change notification settings - Fork 12.9k
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
Pointer implementation for Rc and Arc should print the address of pointed value #35384
Comments
It's sort of inconsistent, but also sort of consistent. |
The example code from OP does not seem to compile now with rustc 1.22.0-nightly (692b94a 2017-10-09) (anymore?). Would that be something that is expected ? The error:
|
I would like a PR to fix this. Whether the strong and weak counts are stored before or after T in memory seems like an implementation detail, and the address of T seems to me a more intuitive behavior for |
Print the address of the pointed value in Pointer impl for Rc and Arc Fixes rust-lang#35384
Consider this example:
the code runs fine but the printed values are different:
The
Pointer
implementation forRc
andArc
prints the address of the inner data (RcBox
andArcInner
) instead of the address of the stored value. This seems to be inconsistent with thePointer
implementation forBox
,Shared
andUnique
.If this is a real issue, I can write a patch to fix it.
The text was updated successfully, but these errors were encountered: