1. 17 2月, 2018 8 次提交
    • S
      Replace dummy spans with empty spans · b5099a70
      Seiichi Uchida 提交于
      b5099a70
    • S
      Change ast::Visibility to Spanned type · d6bdf296
      Seiichi Uchida 提交于
      d6bdf296
    • S
      Add a span field to Visibility::Restricted · 0bddba92
      Seiichi Uchida 提交于
      This span covers the whole visibility expression: e.g. `pub (in path)`.
      0bddba92
    • S
      01a70c65
    • B
      Auto merge of #47956 - retep998:is-nibbles, r=BurntSushi · b2986078
      bors 提交于
      This is the ideal FileType on Windows. You may not like it, but this is what peak performance looks like.
      
      Theoretically this would fix https://github.com/rust-lang/rust/issues/46484
      
      The current iteration of this PR should not cause existing code to break, but instead merely improves handling around reparse points. Specifically...
      
      * Reparse points are considered to be symbolic links if they have the name surrogate bit set. Name surrogates are reparse points that effectively act like symbolic links, redirecting you to a different directory/file. By checking for this bit instead of specific tags, we become much more general in our handling of reparse points, including those added by third parties.
      * If something is a reparse point but does not have the name surrogate bit set, then we ignore the fact that it is a reparse point because it is actually a file or directory directly there, despite having additional handling by drivers due to the reparse point.
      * For everything which is not a symbolic link (including non-surrogate reparse points) we report whether it is a directory or a file based on the presence of the directory attribute bit.
      * Notably this still preserves invariant that when `is_symlink` returns `true`, both `is_dir` and `is_file` will return `false`. The potential for breakage was far too high.
      * Adds an unstable `FileTypeExt` to allow users to determine whether a symbolic link is a directory or a file, since `FileType` by design is incapable of reporting this information.
      b2986078
    • B
      Auto merge of #47926 - mikhail-m1:subslice_pattern_array_drop2, r=nikomatsakis · b85bd51c
      bors 提交于
      add transform for uniform array move out
      
      reworked second step for fix #34708
      previous try #46686
      r? @nikomatsakis
      b85bd51c
    • B
      Auto merge of #47917 - davidtwco:issue-47703, r=nikomatsakis · 507a46a4
      bors 提交于
      Fixes NLL: error from URL crate
      
      Fixes #47703.
      
      r? @nikomatsakis
      507a46a4
    • B
      Auto merge of #47906 - Zoxc:nocycle, r=nikomatsakis · 554fe71a
      bors 提交于
      Add a `fatal_cycle` attribute for queries which indicates that they will cause a fatal error on query cycles
      
      This moves us towards the goal of having cycle errors be non-fatal by not relying on the default implementation of `ty::maps::values::Value` which aborts on errors.
      
      r? @nikomatsakis
      554fe71a
  2. 16 2月, 2018 6 次提交
    • B
      Auto merge of #48252 - Mark-Simulacrum:exclude-paths, r=alexcrichton · 58a8e0c2
      bors 提交于
      Fix not running some steps in CI
      
      We'd previously assumed that these paths would be relative to the src
      dir, and that for example our various CI scripts would, when calling
      x.py, use `../x.py build ../src/tools/...` but this isn't the case --
      they use `../x.py` without using the relevant source-relative path.
      
      We eventually may want to make this (actually somewhat logical) change,
      but this is not that time.
      
      r? @kennytm
      58a8e0c2
    • K
      Fix panic when `x.py` is called without any arguments. · c788433b
      kennytm 提交于
      c788433b
    • B
      Auto merge of #46714 - leodasvacas:refactor-structurally-resolve-type, r=nikomatsakis · 5570cdcc
      bors 提交于
      Refactor diverging and numeric fallback.
      
      This refactoring tries to make numeric fallback easier to reason about. Instead of applying all fallbacks at an arbitrary point in the middle of inference, we apply the fallback only when necessary and only for
      the variable that requires it. The only place that requires early fallback is the target of numeric casts.
      
      The  visible consequences is that some error messages that got `i32` now get `{integer}` because we are less eager about fallback.
      
      The bigger goal is to make it easier to integrate user fallbacks into inference, if we ever figure that out.
      5570cdcc
    • M
      Consider paths passed to x.py to be root-relative. · 366a6566
      Mark Simulacrum 提交于
      We'd previously assumed that these paths would be relative to the src
      dir, and that for example our various CI scripts would, when calling
      x.py, use `../x.py build ../src/tools/...` but this isn't the case --
      they use `../x.py` without using the relevant source-relative path.
      
      We eventually may want to make this (actually somewhat logical) change,
      but this is not that time.
      366a6566
    • M
      Prevent silently ignoring unmatched paths · e78ecd2e
      Mark Simulacrum 提交于
      Primarily for CI purposes; this is intended to avoid cases where we
      update rustbuild and unintentionally make CI stop running some builds to
      the arguments being passed no longer applying for some reason.
      e78ecd2e
    • B
      Auto merge of #45404 - giannicic:defaultimpl2, r=nikomatsakis · efda9bae
      bors 提交于
      #37653 support `default impl` for specialization
      
      this commit implements the second part of the `default impl` feature:
      
      >  - a `default impl` need not include all items from the trait
      >  - a `default impl` alone does not mean that a type implements the trait
      
      The first point allows rustc to compile and run something like this:
      
      ```
      trait Foo {
          fn foo_one(&self) -> &'static str;
          fn foo_two(&self) -> &'static str;
      }
      
      default impl<T> Foo for T {
          fn foo_one(&self) -> &'static str {
              "generic"
          }
      }
      
      struct MyStruct;
      
      fn  main() {
          assert!(MyStruct.foo_one() == "generic");
      }
      ```
      
      but it shows a proper error if trying to call `MyStruct.foo_two()`
      
      The second point allows a `default impl` to be considered as not implementing the `Trait` if it doesn't implement all the trait items.
      The tests provided (in the compile-fail section) should cover all the possible trait resolutions.
      Let me know if some tests is missed.
      
      See [referenced ](https://github.com/rust-lang/rust/issues/37653) issue for further info
      
      r? @nikomatsakis
      efda9bae
  3. 15 2月, 2018 16 次提交
  4. 14 2月, 2018 10 次提交
    • J
    • K
      Rollup merge of #48035 - technicalguy:Early-exit-empty-hashmap-38880, r=arthurprs · ce89c3de
      kennytm 提交于
      Early exit for empty HashMap (issue #38880)
      
      Addresses issue #38880 by checking if the HashMap is empty before computing the value of the hash.
      
      Before (integer keys)
      ```
      running 4 tests
      test empty_once ... bench:          13 ns/iter (+/- 0)
      test empty_100  ... bench:       1,367 ns/iter (+/- 35)
      test exist_once ... bench:          14 ns/iter (+/- 0)
      test exist_100  ... bench:       1,518 ns/iter (+/- 40)
      ```
      
      After
      ```
      running 4 tests
      test empty_once ... bench:           2 ns/iter (+/- 0)
      test empty_100  ... bench:         221 ns/iter (+/- 0)
      test exist_once ... bench:          15 ns/iter (+/- 0)
      test exist_100  ... bench:       1,515 ns/iter (+/- 92)
      ```
      
      When the HashMap is not empty, the performance remains the same, and when it is empty the performance is significantly improved.
      ce89c3de
    • K
      Rollup merge of #48195 - paoloteti:compiler-builtins-update, r=alexcrichton · 6436c442
      kennytm 提交于
      Update compiler-builtins to latest master.
      
      - Rebase compiler-rt submodule to LLVM 6
      - New VFP intrinsics on ARM
      - Add generic conversion from a narrower to a wider FP type (f32 to f64)
      - Fixes minor issues on _subsf3, __subdf3 and __aeabi_fcmple
      - Split test suite to a separate crate
      6436c442
    • K
      Rollup merge of #48186 - Mark-Simulacrum:release-notes-cargo, r=alexcrichton · 72ef62a8
      kennytm 提交于
      Add note about Cargo cwd change to release notes
      
      r? @alexcrichton
      72ef62a8
    • K
      Rollup merge of #48181 - michaelwoerister:fix-incr-dir-finalization, r=nikomatsakis · accadb2c
      kennytm 提交于
      incr.comp.: Run cache directory garbage collection before loading dep-graph.
      
      Prior to this PR, the incr. comp. cache directory would only be garbage collected after the final output artifacts were generated. However, compilation often aborts earlier and in the case of the RLS, which starts lots of compilation sessions, we might fill up the cache directory with chunk sessions.
      
      This PR makes the compiler do a garbage collection run before loading the dep-graph.
      
      cc @nrc https://github.com/rust-lang/rust/issues/48172
      
      r? @nikomatsakis
      accadb2c
    • K
      Rollup merge of #48167 - Mark-Simulacrum:remove-allocation-codemap, r=estebank · dc9d93f2
      kennytm 提交于
      Remove allocation from width of character function.
      
      Locally this seems to eliminate the problem or at least resolve most of the
      issue.
      
      Fixes #48153.
      
      r? @estebank
      dc9d93f2
    • K
      Rollup merge of #48165 - alexcrichton:update-read2, r=Mark-Simulacrum · 526e9548
      kennytm 提交于
      Update compiletest's `read2` function
      
      This was originally copied over from Cargo and Cargo has since [been
      updated][update] so let's pull in the fixes here too!
      
      [update]: https://github.com/rust-lang/cargo/pull/5030
      526e9548
    • K
      Rollup merge of #48163 - alexcrichton:persistent-linker, r=rkruppe · 92c66b78
      kennytm 提交于
      rustc: Persist LLVM's `Linker` in Fat LTO
      
      This commit updates our Fat LTO logic to tweak our custom wrapper around LLVM's
      "link modules" functionality. Previously whenever the
      `LLVMRustLinkInExternalBitcode` function was called it would call LLVM's
      `Linker::linkModules` wrapper. Internally this would crate an instance of a
      `Linker` which internally creates an instance of an `IRMover`. Unfortunately for
      us the creation of `IRMover` is somewhat O(n) with the input module. This means
      that every time we linked a module it was O(n) with respect to the entire module
      we had built up!
      
      Now the modules we build up during LTO are quite large, so this quickly started
      creating an O(n^2) problem for us! Discovered in #48025 it turns out this has
      always been a problem and we just haven't noticed it. It became particularly
      worse recently though due to most libraries having 16x more object files than
      they previously did (1 -> 16).
      
      This commit fixes this performance issue by preserving the `Linker` instance
      across all links into the main LLVM module. This means we only create one
      `IRMover` and allows LTO to progress much speedier.
      
      From the `cargo-cache` project in #48025 a **full build** locally went from
      5m15s to 2m24s. Looking at the timing logs each object file was linked in in
      single-digit millisecond rather than hundreds, clearly being a nice improvement!
      
      Closes #48025
      92c66b78
    • K
      Rollup merge of #48162 - michaelwoerister:stabler-svh, r=nikomatsakis · d38e11ee
      kennytm 提交于
      Handle path prefix mapping in a more stable way when computing the crate hash
      
      This hopefully fixes issue https://github.com/rust-lang/rust/issues/48019.
      
      cc @luser @infinity0
      d38e11ee
    • K
      Rollup merge of #48156 - Centril:feature/iterator_repeat_with, r=alexcrichton · bebd2fbf
      kennytm 提交于
      Add std/core::iter::repeat_with
      
      Adds an iterator primitive `repeat_with` which is the "lazy" version of `repeat` but also more flexible since you can build up state with the `FnMut`. The design is mostly taken from `repeat`.
      
      r? @rust-lang/libs
      cc @withoutboats, @scottmcm
      bebd2fbf