1. 28 2月, 2014 11 次提交
    • B
      auto merge of #12348 : brunoabinader/rust/libcollections-list-refactory, r=alexcrichton · f203fc7d
      bors 提交于
      This PR includes:
      - Create an iterator for ```List<T>``` called ```Items<T>```;
      - Move all list operations inside ```List<T>``` impl;
      - Removed functions that are already provided by ```Iterator``` trait;
      - Refactor on ```len()``` and ```is_empty``` using ```Container``` trait;
      - Bunch of minor fixes;
      
      A replacement for using @ is intended, but still in discussion.
      
      Closes #12344.
      f203fc7d
    • B
      auto merge of #11979 : FlaPer87/rust/static, r=nikomatsakis · 700fd35f
      bors 提交于
      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
      700fd35f
    • B
      auto merge of #12584 : alexcrichton/rust/windows-files, r=brson · f01a9a8d
      bors 提交于
      These commits fix handling of binary files on windows by using the raw `CreateFile` apis directly, also splitting out the windows/unix implementations to their own files because everything was configured between the two platforms.
      
      With this fix in place, this also switches `rustc` to using libnative instead of libgreen. I have confirmed that this PR passes through try on all bots.
      f01a9a8d
    • A
      native: Recognize EISDIR · 8c157ed6
      Alex Crichton 提交于
      This recognizes the EISDIR error code on both windows and unix platforms to
      provide a more descriptive error condition.
      8c157ed6
    • A
      rustc: Use libnative for the compiler · 40ab1983
      Alex Crichton 提交于
      The compiler itself doesn't necessarily need any features of green threading
      such as spawning tasks and lots of I/O, so libnative is slightly more
      appropriate for rustc to use itself.
      
      This should also help the rusti bot which is currently incompatible with libuv.
      40ab1983
    • A
      native: Improve windows file handling · cd9010c7
      Alex Crichton 提交于
      This commit splits the file implementation into file_unix and file_win32. The
      two implementations have diverged to the point that they share almost 0 code at
      this point, so it's easier to maintain as separate files.
      
      The other major change accompanied with this commit is that file::open is no
      longer based on libc's open function on windows, but rather windows's CreateFile
      function. This fixes dealing with binary files on windows (test added in
      previous commit).
      
      This also changes the read/write functions to use ReadFile and WriteFile instead
      of libc's read/write.
      
      Closes #12406
      cd9010c7
    • A
      std: Small cleanup and test improvement · 843c5e63
      Alex Crichton 提交于
      This weeds out a bunch of warnings building stdtest on windows, and it also adds
      a check! macro to the io::fs tests to help diagnose errors that are cropping up
      on windows platforms as well.
      
      cc #12516
      843c5e63
    • F
      59a04f5b
    • F
      Closes #7364 Test case · 0c7a0125
      Flavio Percoco 提交于
      0c7a0125
    • F
      Closes #9243 Test case · 49d5d709
      Flavio Percoco 提交于
      49d5d709
    • F
      Forbid certain types for static items · ee2f001a
      Flavio Percoco 提交于
      - 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)
          - does not contain a struct literal or call to an enum
              variant / struct constructor where
              - the type of the struct/enum has a dtor
      ee2f001a
  2. 27 2月, 2014 29 次提交