1. 01 10月, 2017 4 次提交
    • B
      Auto merge of #44906 - dkl:main-signature, r=nagisa · 0defa208
      bors 提交于
      Fix native main() signature on 64bit
      
      Hello,
      
      in LLVM-IR produced by rustc on x86_64-linux-gnu, the native main() function had incorrect types for the function result and argc parameter: i64, while it should be i32 (really c_int). See also #20064, #29633.
      
      So I've attempted a fix here. I tested it by checking the LLVM IR produced with --target x86_64-unknown-linux-gnu and i686-unknown-linux-gnu. Also I tried running the tests (`./x.py test`), however I'm getting two failures with and without the patch, which I'm guessing is unrelated.
      0defa208
    • B
      Auto merge of #44921 - est31:master, r=alexcrichton · 1c09315f
      bors 提交于
      Update the libcompiler_builtins submodule
      
      Pulls in the latest changes from libcompiler_builtins.
      
      It should work, but it would be best if this wouldn't get put into a rollup so that bisecting is possible if there is a regression.
      
      r? @alexcrichton
      1c09315f
    • D
      a4e83731
    • B
      Auto merge of #44944 - dbrgn:trace-macros-docs, r=QuietMisdreavus · afe93207
      bors 提交于
      Docs: Add trace_macros! to unstable book
      
      As TIL'd at Rustfest :)
      
      Note: This is unfortunately untested, since I'm on my laptop battery, and compiling LLVM would probably eat at least 50% of it on my dual core CPU. (Is there a way to build docs without compiling LLVM?)
      afe93207
  2. 30 9月, 2017 27 次提交
  3. 29 9月, 2017 9 次提交
    • B
      Auto merge of #44866 - mdevlamynck:impl-trait, r=eddyb · 51cd0617
      bors 提交于
      First step toward implementing impl Trait in argument position
      
      First step implementing #44721.
      
      Add a flag to hir and ty TypeParameterDef and raise an error when using
      explicit type parameters when calling a function using impl Trait in
      argument position.
      
      I don't know if there is a procedure to add an error code so I just took an available code. Is that ok ?
      
      r? @nikomatsakis
      51cd0617
    • B
      Auto merge of #44856 - cuviper:more-fold, r=dtolnay · 09ee9b72
      bors 提交于
      Add more custom folding to `core::iter` adaptors
      
      Many of the iterator adaptors will perform faster folds if they forward
      to their inner iterator's folds, especially for inner types like `Chain`
      which are optimized too.  The following types are newly specialized:
      
      | Type        | `fold` | `rfold` |
      | ----------- | ------ | ------- |
      | `Enumerate` | ✓      | ✓       |
      | `Filter`    | ✓      | ✓       |
      | `FilterMap` | ✓      | ✓       |
      | `FlatMap`   | exists | ✓       |
      | `Fuse`      | ✓      | ✓       |
      | `Inspect`   | ✓      | ✓       |
      | `Peekable`  | ✓      | N/A¹    |
      | `Skip`      | ✓      | N/A²    |
      | `SkipWhile` | ✓      | N/A¹    |
      
      ¹ not a `DoubleEndedIterator`
      
      ² `Skip::next_back` doesn't pull skipped items at all, but this couldn't
      be avoided if `Skip::rfold` were to call its inner iterator's `rfold`.
      
      Benchmarks
      ----------
      
      In the following results, plain `_sum` computes the sum of a million
      integers -- note that `sum()` is implemented with `fold()`.  The
      `_ref_sum` variants do the same on a `by_ref()` iterator, which is
      limited to calling `next()` one by one, without specialized `fold`.
      
      The `chain` variants perform the same tests on two iterators chained
      together, to show a greater benefit of forwarding `fold` internally.
      
          test iter::bench_enumerate_chain_ref_sum  ... bench:   2,216,264 ns/iter (+/- 29,228)
          test iter::bench_enumerate_chain_sum      ... bench:     922,380 ns/iter (+/- 2,676)
          test iter::bench_enumerate_ref_sum        ... bench:     476,094 ns/iter (+/- 7,110)
          test iter::bench_enumerate_sum            ... bench:     476,438 ns/iter (+/- 3,334)
      
          test iter::bench_filter_chain_ref_sum     ... bench:   2,266,095 ns/iter (+/- 6,051)
          test iter::bench_filter_chain_sum         ... bench:     745,594 ns/iter (+/- 2,013)
          test iter::bench_filter_ref_sum           ... bench:     889,696 ns/iter (+/- 1,188)
          test iter::bench_filter_sum               ... bench:     667,325 ns/iter (+/- 1,894)
      
          test iter::bench_filter_map_chain_ref_sum ... bench:   2,259,195 ns/iter (+/- 353,440)
          test iter::bench_filter_map_chain_sum     ... bench:   1,223,280 ns/iter (+/- 1,972)
          test iter::bench_filter_map_ref_sum       ... bench:     611,607 ns/iter (+/- 2,507)
          test iter::bench_filter_map_sum           ... bench:     611,610 ns/iter (+/- 472)
      
          test iter::bench_fuse_chain_ref_sum       ... bench:   2,246,106 ns/iter (+/- 22,395)
          test iter::bench_fuse_chain_sum           ... bench:     634,887 ns/iter (+/- 1,341)
          test iter::bench_fuse_ref_sum             ... bench:     444,816 ns/iter (+/- 1,748)
          test iter::bench_fuse_sum                 ... bench:     316,954 ns/iter (+/- 2,616)
      
          test iter::bench_inspect_chain_ref_sum    ... bench:   2,245,431 ns/iter (+/- 21,371)
          test iter::bench_inspect_chain_sum        ... bench:     631,645 ns/iter (+/- 4,928)
          test iter::bench_inspect_ref_sum          ... bench:     317,437 ns/iter (+/- 702)
          test iter::bench_inspect_sum              ... bench:     315,942 ns/iter (+/- 4,320)
      
          test iter::bench_peekable_chain_ref_sum   ... bench:   2,243,585 ns/iter (+/- 12,186)
          test iter::bench_peekable_chain_sum       ... bench:     634,848 ns/iter (+/- 1,712)
          test iter::bench_peekable_ref_sum         ... bench:     444,808 ns/iter (+/- 480)
          test iter::bench_peekable_sum             ... bench:     317,133 ns/iter (+/- 3,309)
      
          test iter::bench_skip_chain_ref_sum       ... bench:   1,778,734 ns/iter (+/- 2,198)
          test iter::bench_skip_chain_sum           ... bench:     761,850 ns/iter (+/- 1,645)
          test iter::bench_skip_ref_sum             ... bench:     478,207 ns/iter (+/- 119,252)
          test iter::bench_skip_sum                 ... bench:     315,614 ns/iter (+/- 3,054)
      
          test iter::bench_skip_while_chain_ref_sum ... bench:   2,486,370 ns/iter (+/- 4,845)
          test iter::bench_skip_while_chain_sum     ... bench:     633,915 ns/iter (+/- 5,892)
          test iter::bench_skip_while_ref_sum       ... bench:     666,926 ns/iter (+/- 804)
          test iter::bench_skip_while_sum           ... bench:     444,405 ns/iter (+/- 571)
      09ee9b72
    • B
      Auto merge of #44853 - alexcrichton:debug-codegen-units, r=michaelwoerister · d514263c
      bors 提交于
      rustc: Default 32 codegen units at O0
      
      This commit changes the default of rustc to use 32 codegen units when compiling
      in debug mode, typically an opt-level=0 compilation. Since their inception
      codegen units have matured quite a bit, gaining features such as:
      
      * Parallel translation and codegen enabling codegen units to get worked on even
        more quickly.
      * Deterministic and reliable partitioning through the same infrastructure as
        incremental compilation.
      * Global rate limiting through the `jobserver` crate to avoid overloading the
        system.
      
      The largest benefit of codegen units has forever been faster compilation through
      parallel processing of modules on the LLVM side of things, using all the cores
      available on build machines that typically have many available. Some downsides
      have been fixed through the features above, but the major downside remaining is
      that using codegen units reduces opportunities for inlining and optimization.
      This, however, doesn't matter much during debug builds!
      
      In this commit the default number of codegen units for debug builds has been
      raised from 1 to 32. This should enable most `cargo build` compiles that are
      bottlenecked on translation and/or code generation to immediately see speedups
      through parallelization on available cores.
      
      Work is being done to *always* enable multiple codegen units (and therefore
      parallel codegen) but it requires #44841 at least to be landed and stabilized,
      but stay tuned if you're interested in that aspect!
      d514263c
    • B
      Auto merge of #44847 - estebank:unused-signature, r=nikomatsakis · 0253d983
      bors 提交于
      Point at signature on unused lint
      
      ```
      warning: struct is never used: `Struct`
        --> $DIR/unused-warning-point-at-signature.rs:22:1
         |
      22 | struct Struct {
         | ^^^^^^^^^^^^^
      ```
      
      Fix #33961.
      0253d983
    • J
      Remove conflicting TryFrom impls on 32-bit targets. · 1a29e822
      Jimmy Cuadra 提交于
      1a29e822
    • B
      Auto merge of #44811 - zilbuz:issue-44596/E0506, r=arielb1 · a379780f
      bors 提交于
      MIR-borrowck: Adding notes to E0506
      
      This PR adds notes to the MIR borrowck error E0506.
      
      Part of #44596
      a379780f
    • B
      Auto merge of #44528 - tmnilsson:attr_proc_macro_cfg_process, r=jseyfried · 46ef6208
      bors 提交于
      Apply attr proc macros before cfg processing
      
      Fixes #39336.
      r? @jseyfried
      46ef6208
    • D
      test: Check native main() signature · 6c3f1900
      Daniel Klauer 提交于
      6c3f1900
    • D
      rustc: Fix main() entry point signature on 64bit · c2fe69b9
      Daniel Klauer 提交于
      To match the C signature, main() should be generated with C int type
      for the argc parameter and result, i.e. i32 instead of i64 on 64bit.
      
      That way it no longer relies on the upper 32 bits being zero, which I'm
      not sure is guaranteed by ABIs or startup code.
      c2fe69b9