1. 13 7月, 2018 12 次提交
    • B
      Auto merge of #51622 - kennytm:three-field-range-inclusive, r=SimonSapin · c0955a34
      bors 提交于
      Change RangeInclusive to a three-field struct.
      
      Fix #45222.
      
      This PR also reverts #48012 (i.e. removed the `try_fold`/`try_rfold` specialization for `RangeInclusive`) because LLVM no longer has trouble recognizing a RangeInclusive loop.
      c0955a34
    • B
      Auto merge of #52281 - cramertj:fast-tls, r=alexcrichton · 8b48b247
      bors 提交于
      Use fast TLS on Fuchsia
      
      I'm not sure why Fuchsia was separated here, but we provide these symbols, and tests are passing in QEMU with this change. cc @raphlinus.
      
      r? @alexcrichton
      8b48b247
    • K
    • B
      Auto merge of #52275 - alexcrichton:no-macro-use, r=nrc · 68c39b9f
      bors 提交于
      rustc: Lint against `#[macro_use]` in 2018 idioms
      
      This commit adds a lint to the compiler to warn against the `#[macro_use]`
      directive as part of the `rust_2018_idioms` lint. This lint is turned off by
      default and is only enabled when the `use_extern_macros` feature is also
      enabled.
      
      The lint here isn't fully fleshed out as it's just a simple warning rather than
      suggestions of how to actually import the macro, but hopefully it's a good base
      to start from!
      
      cc #52043
      68c39b9f
    • K
      Include is_empty() in PartialEq and Hash. · 6e0dd9ec
      kennytm 提交于
      When the index is not PartialOrd, always treat the range as empty.
      6e0dd9ec
    • K
      Upgrade implementation of StepBy<RangeInclusive<_>>. · b6ea93e4
      kennytm 提交于
      b6ea93e4
    • K
      Fix some RangeInclusive test cases. · d299f03e
      kennytm 提交于
      d299f03e
    • K
      Change RangeInclusive to a three-field struct. · 0d7e9933
      kennytm 提交于
      Fix #45222.
      0d7e9933
    • B
      Auto merge of #52046 - cramertj:fix-generator-mir, r=eddyb · e92e9ce0
      bors 提交于
      Ensure StorageDead is created even if variable initialization fails
      
      Rebase and slight cleanup of https://github.com/rust-lang/rust/pull/51109
      Fixes https://github.com/rust-lang/rust/issues/49232
      
      r? @EddyB
      e92e9ce0
    • A
      rustc: Lint against `#[macro_use]` in 2018 idioms · 0b969a9d
      Alex Crichton 提交于
      This commit adds a lint to the compiler to warn against the `#[macro_use]`
      directive as part of the `rust_2018_idioms` lint. This lint is turned off by
      default and is only enabled when the `use_extern_macros` feature is also
      enabled.
      
      The lint here isn't fully fleshed out as it's just a simple warning rather than
      suggestions of how to actually import the macro, but hopefully it's a good base
      to start from!
      
      cc #52043
      0b969a9d
    • B
      Auto merge of #51339 - sdroege:exact-chunks-remainder, r=alexcrichton · 64f7de92
      bors 提交于
      Add ExactChunks::remainder and ExactChunks::into_remainder
      
      These allow to get the leftover items of the slice that are not being
      iterated as part of the iterator due to not filling a complete chunk.
      
      The mutable version consumes the slice because otherwise we would either
      a) have to borrow the iterator instead of taking the lifetime of
      the underlying slice, which is not what *any* of the other iterator
      functions is doing, or
      b) would allow returning multiple mutable references to the same data
      
      The current behaviour of consuming the iterator is consistent with
      IterMut::into_slice for the normal iterator.
      
      ----
      
      This is related to https://github.com/rust-lang/rust/issues/47115#issuecomment-392685177 and the following comments.
      
      While there the discussion was first about a way to get the "tail" of the iterator (everything from the slice that is still not iterated yet), this gives kind of unintuitive behaviour and is inconsistent with how the other slice iterators work.
      
      Unintuitive because the `next_back` would have no effect on the tail (or otherwise the tail could not include the remainder items), inconsistent because a) generally the idea of the slice iterators seems to be to only ever return items that were not iterated yet (and don't provide a way to access the same item twice) and b) we would return a "flat" `&[T]` slice but the iterator's shape is `&[[T]]` instead, c) the mutable variant would have to borrow from the iterator instead of the underlying slice (all other iterator functions borrow from the underlying slice!)
      
      As such, I've only implemented functions to get the remainder. This also allows the implementation to be completely safe still (and around slices instead of raw pointers), while getting the tail would either be inefficient or would have to be implemented around raw pointers.
      
      CC @kerollmops
      64f7de92
    • T
  2. 12 7月, 2018 28 次提交