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

TypeContents code is inscrutable #10157

Closed
nikomatsakis opened this issue Oct 29, 2013 · 4 comments
Closed

TypeContents code is inscrutable #10157

nikomatsakis opened this issue Oct 29, 2013 · 4 comments
Assignees

Comments

@nikomatsakis
Copy link
Contributor

I can say that because I wrote it. Anyway, I have a refactoring I think is cleaner -- it does a better job of distinguishing owned from reachable properties and so forth. Coming soon to a PR near you.

@ghost ghost assigned nikomatsakis Oct 29, 2013
nikomatsakis added a commit to nikomatsakis/rust that referenced this issue Oct 30, 2013
…rser bits

than the current ones, which were very fine-grained.  Also, cleanly distinguish
when properties must be found in *owned* types vs *reachable* types.

Fixes rust-lang#10157
@thestinger
Copy link
Contributor

@nikomatsakis: I'm curious about what the functional difference will be between owned and reachable properties. There are types like Rc sitting on the boundary between those two, because we could add features like copy-on-write via &mut self, where it copies if the reference count is not one.

@nikomatsakis
Copy link
Contributor Author

@thestinger I don't quite know what you mean by "functional difference". In any case, I actually drew 3 distinctions: things that are interior to the type, things that are owned by the type, and things that are reachable. For many purposes (e.g. builtin bounds like Send or Freeze), reachable is generally all that matters. But for others, e.g. move-by-default, ownership is what is important. In some cases, like @T, both matters in different contexts: we need to run drop glue if we own the @T, but not if we can merely reach it (e.g., via a borrowed pointer like &@T).

@thestinger
Copy link
Contributor

Ah, that makes sense.

@nikomatsakis
Copy link
Contributor Author

Ah, that makes sense.

Yes unfortunately there is still some obscure error I've yet to track
down that leads to assertion failures and double frees related to
managed objects. Clearly I'm doing something different.

bors added a commit that referenced this issue Nov 6, 2013
…actor, r=pcwalton

See #10157. This compiles now.

Fixes #10278.
willingc pushed a commit to willingc/rust that referenced this issue Nov 12, 2013
…tents-refactor, r=pcwalton

See rust-lang#10157. This compiles now.

Fixes rust-lang#10278.

Fixed xfail for nbody shootout benchmark by correcting command line parse.
Cleaned up unneeded imports and type changes to resolve compiler warnings.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants