1. 27 11月, 2013 1 次提交
  2. 26 11月, 2013 25 次提交
    • B
      ef70b766
    • B
      auto merge of #10660 : alexcrichton/rust/little-scope, r=pcwalton · 4fe12965
      bors 提交于
      This moves the locking/waiting methods to returning an RAII struct instead of
      relying on closures. Additionally, this changes the methods to all take
      '&mut self' to discourage recursive locking. The new method to block is to call
      `wait` on the returned RAII structure instead of calling it on the lock itself
      (this enforces that the lock is held).
      
      At the same time, this improves the Mutex interface a bit by allowing
      destruction of non-initialized members and by allowing construction of an empty
      mutex (nothing initialized inside).
      4fe12965
    • B
      auto merge of #10622 : Kimundi/rust/str_de_iter, r=alexcrichton · 21990cdd
      bors 提交于
      This PR removes almost all `_iter` suffixes in various APIs of the codebase that return Iterators, as discussed in #9440.
      
      As a summarize for the intend behind this PR:
      
      - Iterators are the recommended way to provide a potentially lazy list of values, no need to name them painfully verbose. If anything, functions that return a specific container type should have more verbose names.
      - We have a static type system, so no need to encode the return value of a constructor function into its name.
      
      Following is a possibly incomplete list of all renamings I performed in the codebase. For a few of them I'm a bit unsure whether the new name still properly expresses their functionality, so feedback would be welcome:
      
      ~~~
      &str : word_iter()             -> words()
             line_iter()             -> lines()
             any_line_iter()         -> lines_any()
             iter()                  -> chars()
             char_offset_iter()      -> char_indices()
             byte_iter()             -> bytes()
             split_iter()            -> split()
             splitn_iter()           -> splitn()
             split_str_iter()        -> split_str()
             split_terminator_iter() -> split_terminator()
             matches_index_iter()    -> match_indices()
             nfd_iter()              -> nfd_chars()
             nfkd_iter()             -> nfkd_chars()
            
      &[T] : split_iter()        -> split()
             splitn_iter()       -> splitn()
             window_iter()       -> windows()
             chunk_iter()        -> chunks()
             permutations_iter() -> permutations()
            
      extra:bitv::Bitv :  rev_liter()    -> rev_iter()
                          common_iter()  -> commons()
                          outlier_iter() -> outliers()
      
      extra::treemap::{...} : lower_bound_iter() -> lower_bound()
                              upper_bound_iter() -> upper_bound()
                             
      std::trie::{...} : bound_iter()       -> bound()
                         lower_bound_iter() -> lower_bound()
                         upper_bound_iter() -> upper_bound()
      
      rustpkg::package_id::{...} : prefixes_iter() -> prefixes()
      
      std::hashmap::{...} : difference_iter()           -> difference()
                            symmetric_difference_iter() -> symmetric_difference()
                            intersection_iter()         -> intersection()
                            union_iter()                -> union()
                           
      std::path::{posix, windows} : component_iter()     -> components()
                                    str_component_iter() -> str_components()
      
      ... not showing all identical renamings for reverse versions
      ~~~
      
      ---
      
      I'm also planning a few more changes, like removing all unnecessary `_rev` constructors (#9391), or reducing the `split` variants on `&str` to a more versatile and concise system.
      21990cdd
    • M
      24b316a3
    • V
      9c6bba91
    • B
      auto merge of #10631 : klutzy/rust/win-fixes, r=alexcrichton · b42c4388
      bors 提交于
      This patchset fixes some parts broken on Win64.
      
      This also adds `--disable-pthreads` flags to llvm on mingw-w64 archs (both 32-bit and 64-bit, not mingw) due to bad performance. See #8996 for discussion.
      b42c4388
    • B
      auto merge of #10316 : klutzy/rust/attr-lint, r=cmr · c6a87c27
      bors 提交于
      This patchset makes warning if crate-level attribute is used at other places, obsolete attributed is used, or unknown attribute is used, since they are usually from mistakes.
      
      Closes #3348
      c6a87c27
    • K
      rustc: Add crate-level attribute lint · fa2077af
      klutzy 提交于
      fa2077af
    • K
      rustc: Update obsolete attribute list · 9432e2a2
      klutzy 提交于
      9432e2a2
    • K
      Add test for unknown attribute lint · b4ad3363
      klutzy 提交于
      b4ad3363
    • K
      rustc: Add lint for unknown attributes · 37f2f717
      klutzy 提交于
      37f2f717
    • B
      auto merge of #10652 : jld/rust/enum-unstruct, r=thestinger · 720bcd81
      bors 提交于
      This is needed so that the FFI works as expected on platforms that don't
      flatten aggregates the way the AMD64 ABI does, especially for `#[repr(C)]`.
      
      This moves more of `type_of` into `trans::adt`, because the type might
      or might not be an LLVM struct.
      
      Closes #10308.
      720bcd81
    • K
      Add tests for attribute lint · 365c44cb
      klutzy 提交于
      365c44cb
    • K
      std: Remove unused attributes · 87b166d9
      klutzy 提交于
      This also enables two tests properly.
      87b166d9
    • K
      rustc: Add lint for obsolete attributes · 1f7bfac9
      klutzy 提交于
      This also moves `#[auto_{en,de}code]` checker from syntax to lint.
      1f7bfac9
    • K
      rustc: Add lint for misplaced crate attributes · 6ff697d3
      klutzy 提交于
      6ff697d3
    • J
      Fix the usual check-fast scoping mistake. · 0c04a26b
      Jed Davis 提交于
      0c04a26b
    • A
      Move LittleLock to using RAII · ac59888d
      Alex Crichton 提交于
      This moves the locking/waiting methods to returning an RAII struct instead of
      relying on closures. Additionally, this changes the methods to all take
      '&mut self' to discourage recursive locking. The new method to block is to call
      `wait` on the returned RAII structure instead of calling it on the lock itself
      (this enforces that the lock is held).
      
      At the same time, this improves the Mutex interface a bit by allowing
      destruction of non-initialized members and by allowing construction of an empty
      mutex (nothing initialized inside).
      ac59888d
    • B
      auto merge of #10650 : andreasots/rust/ipv6-is-in-hex, r=alexcrichton · ffaee0fd
      bors 提交于
      Without this the assert in <tt>rust_malloc_ip6_addr</tt> is triggered as it expects a correctly formatted IPv6 address.
      ffaee0fd
    • B
      auto merge of #10658 : LeoTestard/rust/serialize-rc, r=cmr · e632c440
      bors 提交于
      Implement various traits (IterBytes and extra's Encodable and Decodable) for Rc<T> when T alreay implements the trait.
      e632c440
    • B
      auto merge of #10657 : sanxiyn/rust/pat, r=cmr · 6fe6a6f9
      bors 提交于
      6fe6a6f9
    • L
      Implement IterBytes for Rc<T>. · ae836c1e
      Léo Testard 提交于
      ae836c1e
    • L
      Add an implementation of Encodable and Decodable for Rc. This will be needed... · b6ab4f24
      Léo Testard 提交于
      Add an implementation of Encodable and Decodable for Rc. This will be needed to use Rc in place of @ in libsyntax.
      b6ab4f24
    • S
      Take &Pat in visit_pat · 9028330f
      Seo Sanghyeon 提交于
      9028330f
    • B
      auto merge of #10653 : thestinger/rust/meaningless, r=huonw · 679a2c04
      bors 提交于
      679a2c04
  3. 25 11月, 2013 14 次提交