1. 01 11月, 2016 6 次提交
    • B
      Auto merge of #37299 - devonhollowood:result-unwrap-or-default, r=alexcrichton · ac968c46
      bors 提交于
      Add `unwrap_or_default` method to `Result`
      
      Fixes #37025
      ac968c46
    • B
      Auto merge of #37178 - apasel422:issue-37136, r=alexcrichton · 73f5cad6
      bors 提交于
      Implement `RefUnwindSafe` for atomic types
      
      Closes #37136
      73f5cad6
    • B
      Auto merge of #36595 - bluss:hashmap-usize-for-hash, r=alexcrichton · 265ab659
      bors 提交于
      hashmap: Store hashes as usize internally
      
      We can't use more than usize's bits of a hash to select a bucket anyway,
      so we only need to store that part in the table. This should be an
      improvement for the size of the data structure on 32-bit platforms.
      Smaller data means better cache utilization and hopefully better
      performance.
      
      Fixes #36567
      265ab659
    • B
      Auto merge of #37497 - iirelu:proper-vec-brackets-2, r=steveklabnik · 69ec350f
      bors 提交于
      Make all vec! macros use square brackets: Attempt 2
      
      [The last PR](https://github.com/rust-lang/rust/pull/37476) ended with tears after a valiant struggle with git. I managed to clean up the completely broken history of that into a brand spanking new PR! Yay!
      
      Original:
      
      > Everyone hates the old syntax. I hope. Otherwise this PR has some controversy I wasn't expecting.
      
      > This would be the perfect time to write a lint recommending vec![..] when you use another style.
      
      > Disclaimer: I may have broken something. If I have, I'll fix them when the tests come in. Luckily the chance for a non-syntactical error is pretty low in all this.
      69ec350f
    • I
      Changed most vec! invocations to use square braces · e593c3b8
      iirelu 提交于
      Most of the Rust community agrees that the vec! macro is clearer when
      called using square brackets [] instead of regular brackets (). Most of
      these ocurrences are from before macros allowed using different types of
      brackets.
      
      There is one left unchanged in a pretty-print test, as the pretty
      printer still wants it to have regular brackets.
      e593c3b8
    • B
      Auto merge of #37191 - zackmdavis:we_heard_you_the_first_time_really, r=nikomatsakis · f26eedb5
      bors 提交于
      introing one-time diagnostics: only emit "lint level defined here" once
      
      This is a revised resubmission of PR #34084 (which was closed due to inactivity on account of time constraints on the author's part).
      ---
      
      We introduce a new `one_time_diagnostics` field on
      `rustc::session::Session` to hold a hashset of diagnostic messages we've
      set once but don't want to see again (as uniquified by span and message
      text), "lint level defined here" being the motivating example dealt with
      here.
      
      This is in the matter of #24690.
      ---
      
      r? @nikomatsakis
      f26eedb5
  2. 31 10月, 2016 18 次提交
  3. 30 10月, 2016 7 次提交
    • M
      Fix ICE when attempting to get closure generics. · bdb399db
      Mark-Simulacrum 提交于
      bdb399db
    • B
      Auto merge of #37431 - jseyfried:refactor_crate_config, r=eddyb · 6062e7ed
      bors 提交于
      Move `CrateConfig` from `Crate` to `ParseSess`
      
      This is a syntax-[breaking-change]. Most breakage can be fixed by removing a `CrateConfig` argument.
      r? @EddyB
      6062e7ed
    • B
      Auto merge of #37392 - alexcrichton:more-disable-jemalloc, r=brson · aef5ca55
      bors 提交于
      Disable jemalloc on aarch64/powerpc
      
      Sounds like jemalloc is broken on systems which differ in page size than the
      host it was compiled on (unless an option was passed). This unfortunately
      reduces the portability of binaries created and can often make Rust segfault by
      default. For now let's patch over this by disabling jemalloc until we can figure
      out a better solution.
      
      Closes #36994
      Closes #37320
      cc jemalloc/jemalloc#467
      aef5ca55
    • B
      Auto merge of #37401 - eddyb:lazy-2, r=nikomatsakis · 12382665
      bors 提交于
      [2/n] rustc_metadata: move is_extern_item to trans.
      
      *This is part of a series ([prev](https://github.com/rust-lang/rust/pull/37400) | [next](https://github.com/rust-lang/rust/pull/37402)) of patches designed to rework rustc into an out-of-order on-demand pipeline model for both better feature support (e.g. [MIR-based](https://github.com/solson/miri) early constant evaluation) and incremental execution of compiler passes (e.g. type-checking), with beneficial consequences to IDE support as well.
      If any motivation is unclear, please ask for additional PR description clarifications or code comments.*
      <hr>
      
      Minor cleanup missed by #36551: `is_extern_item` is one of, if not the only `CrateStore` method who takes a `TyCtxt` but doesn't produce something cached in it, and such methods are going away.
      12382665
    • B
      Auto merge of #37400 - eddyb:lazy-1, r=nikomatsakis · ef6f7434
      bors 提交于
      [1/n] Move the MIR map into the type context.
      
      *This is part of a series ([prev]() | [next](https://github.com/rust-lang/rust/pull/37401)) of patches designed to rework rustc into an out-of-order on-demand pipeline model for both better feature support (e.g. [MIR-based](https://github.com/solson/miri) early constant evaluation) and incremental execution of compiler passes (e.g. type-checking), with beneficial consequences to IDE support as well.
      If any motivation is unclear, please ask for additional PR description clarifications or code comments.*
      <hr>
      
      The first commit reorganizes the `rustc::mir` module to contain the MIR types directly without an extraneous `repr` module which serves no practical purpose but is rather an eyesore.
      
      The second commit performs the actual move of the MIR map into the type context, for the purposes of future integration with requesting analysis/lowering by-products through `TyCtxt`.
      
      Local `Mir` bodies need to be mutated by passes (hence `RefCell`), and at least one pass (`qualify_consts`) needs simultaneous access to multiple `Mir` bodies (hence arena-allocation).
      `Mir` bodies loaded from other crates appear as if immutably borrowed (by `.borrow()`-ing one `Ref` and subsequently "leaking" it) to avoid, at least dynamically, *any* possibility of their local mutation.
      
      One caveat is that lint passes can now snoop at the MIR (helpful) or even mutate it (dangerous).
      However, lints are unstable anyway and we can find a way to deal with this in due time.
      Future work will result in a tighter API, potentially hiding mutation *completely* outside of MIR passes.
      ef6f7434
    • B
      Auto merge of #37399 - retep998:heap-of-trouble, r=alexcrichton · 248e7b30
      bors 提交于
      Print out the error when HeapFree failures do occur
      
      cc https://github.com/rust-lang/rust/issues/37395
      
      I'd prefer to use `assert!` instead of `debug_assert!` if the cost is acceptable.
      
      r? @alexcrichton
      248e7b30
    • B
      Auto merge of #37389 - cramertj:cramertj/fn-item-to-unsafe-ptr, r=eddyb · 2b262cf1
      bors 提交于
      rustc_typeck: Allow reification from fn item to unsafe ptr
      
      See https://github.com/rust-lang/rfcs/issues/1762.
      
      I've never contributed to the compiler internals before-- apologies if I'm not going about this the right way.
      2b262cf1
  4. 29 10月, 2016 9 次提交