1. 02 8月, 2017 27 次提交
  2. 01 8月, 2017 13 次提交
    • Q
      71751db4
    • B
      Auto merge of #43568 - arielb1:constant-recovery, r=eddyb · c2407516
      bors 提交于
      trans::mir::constant - fix assignment error recovery
      
      trans::mir::constant - fix assignment error recovery
      
      We used to not store anything when the RHS of an assignment returned an error, which caused ICEs downstream.
      
      Fixes #43197.
      c2407516
    • M
    • M
      b8d44135
    • A
      rustc::hir::map::definitions - fix O(n^2) when disambiguating · 70478ca5
      Ariel Ben-Yehuda 提交于
      Instead of finding the next free disambiguator by incrementing it until
      you find a place, store the next available disambiguator in an hash-map.
      
      This avoids O(n^2) performance when lots of items have the same
      un-disambiguated `DefPathData` - e.g. all `use` items have
      `DefPathData::Misc`.
      70478ca5
    • A
      syntax: avoid loading the same source-file multiple times · c9d14a84
      Ariel Ben-Yehuda 提交于
      We already had a cache for file contents, but we read the source-file
      before testing the cache, causing obvious slowness, so this just avoids
      loading the source-file when the cache already has the contents.
      c9d14a84
    • A
      pacify the merciless tidy · ce0ca763
      Ariel Ben-Yehuda 提交于
      ce0ca763
    • B
      Auto merge of #43560 - QuietMisdreavus:ref-docs, r=steveklabnik · 0bf018c5
      bors 提交于
      add docs for references as a primitive
      
      Just like #43529 did for function pointers, here is a new primitive page for references.
      
      This PR will pull in impls on references if it's a reference to a generic type parameter. Initially i was only able to pull in impls that were re-exported from another crate; crate-local impls got a different representation in the AST, and i had to change how types were resolved when cleaning it. (This is the change at the bottom of `librustdoc/clean/mod.rs`, in `resolve_type`.) I'm unsure the full ramifications of the change, but from what it looks like, it shouldn't impact anything major. Likewise, references to generic type parameters also get the `&'a [mut]` linked to the new page.
      
      cc @rust-lang/docs: Is this sufficient information? The listing of trait impls kinda feels redundant (especially if we can get the automated impl listing sorted again), but i still think it's useful to point out that you can use these in a generic context.
      
      Fixes #15654
      0bf018c5
    • B
      Auto merge of #43552 - petrochenkov:instab, r=jseyfried · 6e8452ee
      bors 提交于
      resolve: Try to fix instability in import suggestions
      
      cc https://github.com/rust-lang/rust/pull/42033
      
      `lookup_import_candidates` walks module graph in DFS order and skips modules that were already visited (which is correct because there can be cycles).
      However it means that if we visited `std::prelude::v1::Result::Ok` first, we will never visit `std::result::Result::Ok` because `Result` will be skipped as already visited (note: enums are also modules here), and otherwise, if we visited `std::result::Result::Ok` first, we will never get to `std::prelude::v1::Result::Ok`.
      What child module of `std` (`prelude` or `result`) we will visit first, depends on randomized hashing, so we have instability in diagnostics.
      
      With this patch modules' children are visited in stable order in `lookup_import_candidates`, this should fix the issue, but let's see what Travis will say.
      
      r? @oli-obk
      6e8452ee
    • B
      Auto merge of #43533 - nrc:macro-save, r=jseyfried, · df90a546
      bors 提交于
      Three small fixes for save-analysis
      
      First commit does some naive deduplication of macro uses. We end up with lots of duplication here because of the weird way we get this data (we extract a use for every span generated by a macro use).
      
      Second commit is basically a typo fix.
      
      Third commit is a bit interesting, it partially reverts a change from #40939 where temporary variables in format! (and thus println!) got a span with the primary pointing at the value stored into the temporary (e.g., `x` in `println!("...", x)`). If `format!` had a definition it should point at the temporary in the macro def, but since it is built-in, that is not possible (for now), so `DUMMY_SP` is the best we can do (using the span in the callee really breaks save-analysis because it thinks `x` is a definition as well as a reference).
      
      There aren't a test for this stuff because: the deduplication is filtered by any of the users of save-analysis, so it is purely an efficiency change. I couldn't actually find an example for the second commit that we have any machinery to test, and the third commit is tested by the RLS, so there will be a test once I update the RLS version and and uncomment the previously failing tests).
      
      r? @jseyfried
      df90a546
    • N
      review changes · 27b9182d
      Nick Cameron 提交于
      27b9182d
    • A
      rustc: Inline bitwise modification operators · dd371a20
      Alex Crichton 提交于
      These need to be inlined across crates to avoid showing up as one-instruction
      functions in profiles! In the benchmark from #43578 this decreased the
      translation item collection step from 30s to 23s, and looks like it also allowed
      vectorization elsewhere of the operations!
      dd371a20
    • J
      Gate LLVMRustHasFeature on LLVM_RUSTLLVM · 881a7246
      Josh Stone 提交于
      Commit c4710203 in #43492 make `LLVMRustHasFeature` "more robust"
      by using `getFeatureTable()`.  However, this function is specific to
      Rust's own LLVM fork, not upstream LLVM-4.0, so we need to use
      `#if LLVM_RUSTLLVM` to guard this call.
      881a7246