-
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
Attempting to move a non-copyable static segfaults #10577
Comments
I thought we didn't allow types with a |
That's an interesting question. I intended the type to not have This will be an interesting conundrum to figure out how to make this type non-copyable but also without destructors. |
@alexcrichton: I could open a pull request adding a non-copyable attribute. The |
I would be on board with a |
We had cc @nikomatsakis and @pcwalton, you guys may have opinions on bringing back the |
Did we really have |
Per discussion in meeting on Jan 14, 2014:
|
I'll work on this one, if that's fine! |
accepted for P-backcompat-lang |
@sfackler could you please update the issue report and use |
Quick update on this issue: The restriction for static items with |
On Wed, Jan 22, 2014 at 02:42:08PM -0800, Flavio Percoco Premoli wrote:
|
Still weighing what I think is best path. The necessity of modifying trans is a drag, although it's temporary. But it feels like constants like |
In theory, if we had a Having two separate sets of rules seems a little odd though. I'd almost prefer to start with the more restrictive path and then loosen it later if necessary. |
You cannot create a |
Oh, I see you wrote "if we had a |
I've grown to like that |
This was discussed in today's meeting. We agreed on what Niko commented |
This pull request partially addresses the 2 issues listed before. As part of the work required for this PR, `NonCopyable` was completely removed. This PR also replaces the content of `type_is_pod` with `TypeContents::is_pod`, although `type_is_content` is currently not being used anywhere. I kept it for consistency with the other functions that exist in this module. cc #10834 cc #10577 Proposed static restrictions ===================== Taken from [this](#11979 (comment)) comment. I expect some code that, at a high-level, works like this: - For each *mutable* static item, check that the **type**: - cannot own any value whose type has a dtor - cannot own any values whose type is an owned pointer - For each *immutable* static item, check that the **value**: - does not contain any ~ or box expressions (including ~[1, 2, 3] sort of things, for now) - does not contain a struct literal or call to an enum variant / struct constructor where - the type of the struct/enum is freeze - the type of the struct/enum has a dtor
This pull request partially addresses the 2 issues listed before. As part of the work required for this PR, `NonCopyable` was completely removed. This PR also replaces the content of `type_is_pod` with `TypeContents::is_pod`, although `type_is_content` is currently not being used anywhere. I kept it for consistency with the other functions that exist in this module. cc #10834 cc #10577 Proposed static restrictions ===================== Taken from [this](#11979 (comment)) comment. I expect some code that, at a high-level, works like this: - For each *mutable* static item, check that the **type**: - cannot own any value whose type has a dtor - cannot own any values whose type is an owned pointer - For each *immutable* static item, check that the **value**: - does not contain any ~ or box expressions (including ~[1, 2, 3] sort of things, for now) - does not contain a struct literal or call to an enum variant / struct constructor where - the type of the struct/enum is freeze - the type of the struct/enum has a dtor
That will segfault inside of memset, preseumably because
AtomicInt
is non-copyable and it's trying to zero out part of.rodata
.The text was updated successfully, but these errors were encountered: