]> git.lizzy.rs Git - rust.git/commitdiff
auto merge of #11979 : FlaPer87/rust/static, r=nikomatsakis
authorbors <bors@rust-lang.org>
Fri, 28 Feb 2014 02:51:53 +0000 (18:51 -0800)
committerbors <bors@rust-lang.org>
Fri, 28 Feb 2014 02:51:53 +0000 (18:51 -0800)
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](https://github.com/mozilla/rust/pull/11979#issuecomment-35768249) 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


Trivial merge