1. 30 4月, 2015 40 次提交
    • A
      Use hash-tables in trait selection · 7ae4a8e9
      Ariel Ben-Yehuda 提交于
      Puts implementations in bins hashed by the fast-reject key, and
      only looks up the relevant impls, reducing O(n^2)-ishness
      
      Before: 688.92user 5.08system 8:56.70elapsed 129%CPU (0avgtext+0avgdata 1208164maxresident)k, LLVM 379.142s
      After: 637.78user 5.11system 8:17.48elapsed 129%CPU (0avgtext+0avgdata 1201448maxresident)k LLVM 375.552s
      
      Performance increase is +7%-ish
      7ae4a8e9
    • A
      Stop using Rc in TraitRef and TraitDef · bd1f7342
      Ariel Ben-Yehuda 提交于
      The former stopped making sense when we started interning substs and made
      TraitRef a 2-word copy type, and I'm moving the latter into an arena as
      they live as long as the type context.
      bd1f7342
    • B
      Auto merge of #24960 - tynopex:patch-doc, r=alexcrichton · f0bd14f7
      bors 提交于
      - Removed misleading comments about now-defunct CreatePipe
      - Actually use std::process::Child in it's example
      - Minor cleanups
      f0bd14f7
    • B
      Auto merge of #24884 - michaelsproul:extended-errors, r=nrc · ac5f595d
      bors 提交于
      I've been working on improving the diagnostic registration system so that it can:
      
      * Check uniqueness of error codes *across the whole compiler*. The current method using `errorck.py` is prone to failure as it relies on simple text search - I found that it breaks when referencing an error's ident within a string (e.g. `"See also E0303"`).
      * Provide JSON output of error metadata, to eventually facilitate HTML output, as well as tracking of which errors need descriptions. The current schema is:
      
      ```
      <error code>: {
          "description": <long description>,
          "use_site": {
              "filename": <filename where error is used>,
              "line": <line in file where error is used>
          }
      }
      ```
      
      [Here's][metadata-dump] a pretty-printed sample dump for `librustc`.
      
      One thing to note is that I had to move the diagnostics arrays out of the diagnostics modules. I really wanted to be able to capture error usage information, which only becomes available as a crate is compiled. Hence all invocations of `__build_diagnostics_array!` have been moved to the ends of their respective `lib.rs` files. I tried to avoid moving the array by making a plugin that expands to nothing but couldn't invoke it in item position and gave up on hackily generating a fake item. I also briefly considered using a lint, but it seemed like it would impossible to get access to the data stored in the thread-local storage.
      
      The next step will be to generate a web page that lists each error with its rendered description and use site. Simple mapping and filtering of the metadata files also allows us to work out which error numbers are absent, which errors are unused and which need descriptions.
      
      [metadata-dump]: https://gist.github.com/michaelsproul/3246846ff1bea71bd049
      ac5f595d
    • B
      Auto merge of #24967 - alexcrichton:rollup, r=alexcrichton · 5449f5d2
      bors 提交于
      5449f5d2
    • A
      Test fixes and rebase conflicts · 1b34c099
      Alex Crichton 提交于
      1b34c099
    • M
      Add metadata output to the diagnostics system. · d27230bb
      Michael Sproul 提交于
      Diagnostic errors are now checked for uniqueness across the compiler and
      error metadata is written to JSON files.
      d27230bb
    • A
      rollup merge of #24921: tamird/bitflags-associated-const · 2edb6438
      Alex Crichton 提交于
      Conflicts:
      	src/librustc/lib.rs
      2edb6438
    • A
      rollup merge of #24873: alexcrichton/fix-windows-stdio · cc04cd4b
      Alex Crichton 提交于
      Conflicts:
      	src/libstd/sys/windows/fs2.rs
      cc04cd4b
    • A
      rollup merge of #24962: tamird/unignore-android-tests · 873a4e36
      Alex Crichton 提交于
      r? @alexcrichton I've tested these locally, so they should all be good to go.
      873a4e36
    • A
      rollup merge of #24961: nham/net_docs_cleanup · bc4b1932
      Alex Crichton 提交于
      Changes made include adding missing punctuation, adding missing words, and converting uses of "Gets" to "Returns" in libstd/net/addr.rs to make it more consistent with the other documentation.
      
      Fixes #24925.
      bc4b1932
    • A
      rollup merge of #24953: tamird/android-pie · 2c283483
      Alex Crichton 提交于
      This is OK to do given:
        - PIE is supported on Android starting with API 16.
        - The bots are running API 18.
        - API < 16 now has a 12.5% market share[0] as of 2015-04-29.
      
      Closes #17437.
      
      [0] https://developer.android.com/about/dashboards/index.html
      
      r? @alexcrichton
      2c283483
    • A
      rollup merge of #24952: pnkfelix/put-back-missing-dash-g-in-24687-test · 50b3dce4
      Alex Crichton 提交于
      Add `-g` (to testcase) that I should have included in PR #24932.
      
      Note it is safe, with respect to autobuilds, to land before #24945.
      
      (In other words, landing this sooner won't break things for anyone any
      worse than they were already broken, since there are *other* tests
      that also add `-g` to their flags via `compile-flags: -g`.)
      50b3dce4
    • A
      rollup merge of #24945: pnkfelix/fixes-for-dash-g-handling · 5d85d8d8
      Alex Crichton 提交于
      Fixes for -g handling
      
      First:
       * decouples our handling of `-g` for the test suite from our handling of `-g` for the rest of the compiler/stdlib building.
       * Namely, if you do `--enable-debug` or `--enable-debuginfo`, that should only affect `rustc` and the standard library crates; the tests should all continue to compile without `-g` unless:
         * you pass `--enable-debuginfo-tests`, or
         * the test itself requests the `-g` option (e.g. via a `// compile-flags: -g` embedded comment).
      
      Second:
       * Makes `rustc` more flexible in that it now accepts multiple occurrences of `-g -g`
       * (as a drive-by, I gave `-O` the same treatment: multiple occurrences of `-O` are treated as synonymous as a single occurrence of `-O`.
      
      Fix #24937
      5d85d8d8
    • A
      rollup merge of #24935: pnkfelix/lint-repr-c-drop · 373d6202
      Alex Crichton 提交于
      Lint: warn when mixing `#[repr(C)]` with Drop
      
      Fix #24585
      373d6202
    • A
      rollup merge of #24933: oli-obk/patch-1 · 0cca5771
      Alex Crichton 提交于
      compiler plugins are hosted unter "compiler-plugins.html" not "plugins.html"
      0cca5771
    • A
      rollup merge of #24931: jooert/patch-1 · dd12c8b4
      Alex Crichton 提交于
      Since #24783, the style guidelines recommend that unit tests should live in a submodule `tests` rather than `test` to not clash with the possible use of libtest. This is especially important for benchmark tests as they require libtest. Fixes #24923.
      dd12c8b4
    • A
      rollup merge of #24930: nrc/save-fn · 416e4127
      Alex Crichton 提交于
      416e4127
    • A
      rollup merge of #24929: tamird/unstub-some-tests · 62bd19ff
      Alex Crichton 提交于
      r? @alexcrichton
      62bd19ff
    • A
      rollup merge of #24926: frewsxcv/patch-20 · b9b1312f
      Alex Crichton 提交于
      b9b1312f
    • A
      rollup merge of #24917: zecozephyr/nullptropt · 7510bfeb
      Alex Crichton 提交于
      7510bfeb
    • A
      rollup merge of #24911: GBGamer/patch-4 · fa661286
      Alex Crichton 提交于
      fa661286
    • A
      rollup merge of #24908: inrustwetrust/once_memory_ordering · 0eaa811f
      Alex Crichton 提交于
      `call_once` guarantees that there is a happens-before relationship between its closure and code following it via the sequentially consistent atomic store/loads of `self.cnt`.
      0eaa811f
    • A
      rollup merge of #24904: steveklabnik/remove_std_net_warning · b0f920ac
      Alex Crichton 提交于
      This is served by stability markers.
      b0f920ac
    • A
      rollup merge of #24903: pnkfelix/fsk-enum-swapindrop · 91dfc389
      Alex Crichton 提交于
      rename `schedule_drop_{enum,adt}_contents`.
      
      addresses review nit from #24765 (it was my mistake for not doing this earlier before it landed).
      91dfc389
    • A
      rollup merge of #24894: bguiz/diagnostic-E0267 · 4ff558cd
      Alex Crichton 提交于
      This error indicates that a constant references itself.
      All constants need to resolve to a value in an acyclic manner.
      
      For example, neither of the following can be sensibly compiled:
      
      ```
      const X: u32 = X;
      ```
      
      ```
      const X: u32 = Y;
      const Y: u32 = X;
      ```
      4ff558cd
    • A
      rollup merge of #24886: GBGamer/master · 783b4bbf
      Alex Crichton 提交于
      These are useful when you want to catch the signals, like when you're making a kernel, or if you just don't want the overhead. (I don't know if there are any of the second kind of people, I don't think it's a good idea, but hey, choice is good).
      783b4bbf
    • A
      rollup merge of #24881: chris-morgan/issue-24872 · 8daf961a
      Alex Crichton 提交于
      Fixes #24872.
      8daf961a
    • A
      rollup merge of #24871: mbrubeck/doc-edit · a24e0361
      Alex Crichton 提交于
      r? @steveklabnik
      a24e0361
    • A
      rollup merge of #24870: tshepang/reference-fix-brackets · 18a0269d
      Alex Crichton 提交于
      Also, remove the other brackets, because they make the whole sentence look awkward.
      18a0269d
    • A
      rollup merge of #24862: barometz/intro-push-err-fix · 256023a2
      Alex Crichton 提交于
      The error in the Brief Introduction shows the problematic line as "x.push(4)", while the example code uses a vector of strings.
      256023a2
    • A
      rollup merge of #24846: dotdash/fast_cttz8 · 41ee6df2
      Alex Crichton 提交于
      Currently, LLVM lowers a cttz8 on x86_64 to these instructions:
      
      ```asm
          movzbl      %dil, %eax
          bsfl        %eax, %eax
          movl        $32, %ecx
          cmovnel     %eax, %ecx
          cmpl        $32, %ecx
          movl        $8, %eax
          cmovnel     %ecx, %eax
      ```
      
      To improve the codegen, we can zero extend the 8 bit integer, then set
      bit 8 and perform a cttz operation on the extended value. That way
      there's no conditional operation involved at all.
      
      This was discovered by  this benchmark: https://github.com/Kimundi/long_strings_without_repeats
      
      Timings on my box with the current nightly:
      ```
      running 4 tests
      test bench_cpp_naive_big     ... bench:   5479222 ns/iter (+/- 254222)
      test bench_noop_big          ... bench:    571405 ns/iter (+/- 111950)
      test bench_rust_naive_big    ... bench:   7798102 ns/iter (+/- 148841)
      test bench_rust_unsafe_big   ... bench:   6606488 ns/iter (+/- 67529)
      ```
      
      Timings with the patch applied:
      ```
      running 4 tests
      test bench_cpp_naive_big     ... bench:   5470944 ns/iter (+/- 7109)
      test bench_noop_big          ... bench:    568944 ns/iter (+/- 6895)
      test bench_rust_naive_big    ... bench:   6795901 ns/iter (+/- 43806)
      test bench_rust_unsafe_big   ... bench:   5584879 ns/iter (+/- 5291)
      ```
      41ee6df2
    • A
      rollup merge of #24833: tari/rfc888 · dfb60802
      Alex Crichton 提交于
      Closes #24118, implementing RFC 888.
      dfb60802
    • A
      rollup merge of #24762: nrc/mod-debug-2 · 3434469b
      Alex Crichton 提交于
      Closes #20780
      
      r? @michaelwoerister
      
      I'm sure this could be done better with deeper knowledge of debuginfo, but this seems like a good start.
      3434469b
    • A
      rollup merge of #24711: alexcrichton/fs2.1 · e14af089
      Alex Crichton 提交于
      This commit is an implementation of [RFC 1044][rfc] which adds additional
      surface area to the `std::fs` module. All new APIs are `#[unstable]` behind
      assorted feature names for each one.
      
      [rfc]: https://github.com/rust-lang/rfcs/pull/1044
      
      The new APIs added are:
      
      * `fs::canonicalize` - bindings to `realpath` on unix and
        `GetFinalPathNameByHandle` on windows.
      * `fs::symlink_metadata` - similar to `lstat` on unix
      * `fs::FileType` and accessor methods as `is_{file,dir,symlink}`
      * `fs::Metadata::file_type` - accessor for the raw file type
      * `fs::DirEntry::metadata` - acquisition of metadata which is free on Windows
        but requires a syscall on unix.
      * `fs::DirEntry::file_type` - access the file type which may not require a
        syscall on most platforms.
      * `fs::DirEntry::file_name` - access just the file name without leading
        components.
      * `fs::PathExt::symlink_metadata` - convenience method for the top-level
        function.
      * `fs::PathExt::canonicalize` - convenience method for the top-level
        function.
      * `fs::PathExt::read_link` - convenience method for the top-level
        function.
      * `fs::PathExt::read_dir` - convenience method for the top-level
        function.
      * `std::os::raw` - type definitions for raw OS/C types available on all
        platforms.
      * `std::os::$platform` - new modules have been added for all currently supported
        platforms (e.g. those more specific than just `unix`).
      * `std::os::$platform::raw` - platform-specific type definitions. These modules
        are populated with the bare essentials necessary for lowing I/O types into
        their raw representations, and currently largely consist of the `stat`
        definition for unix platforms.
      
      This commit also deprecates `Metadata::{modified, accessed}` in favor of
      inspecting the raw representations via the lowering methods of `Metadata`.
      
      Closes https://github.com/rust-lang/rust/issues/24796
      e14af089
    • A
      rollup merge of #24610: nagisa/offset-docs · b164f661
      Alex Crichton 提交于
      b164f661
    • T
      Update process.rs · 3abba10e
      tynopex 提交于
      Make whitespace consistent
      3abba10e
    • T
      Re-enable tests on Android · 8cdfc8fe
      Tamir Duberstein 提交于
      Addresses part of #10381.
      8cdfc8fe
    • T
      Re-enable test on Android · 97fe4e63
      Tamir Duberstein 提交于
      Closes #9116.
      97fe4e63
    • T
      Reference the correct issue · 02701890
      Tamir Duberstein 提交于
      The problem here is that this test doesn't even compile for Android.
      
      See #24958.
      02701890