1. 08 5月, 2017 7 次提交
  2. 07 5月, 2017 13 次提交
  3. 06 5月, 2017 19 次提交
    • T
      trigger llvm rebuild · f5e3427b
      Tim Neumann 提交于
      f5e3427b
    • J
      Fix definitions of ULONG_PTR · db8be04e
      Joshua Sheard 提交于
      db8be04e
    • A
      Fix "an" usage · a257d5af
      acdenisSK 提交于
      a257d5af
    • E
      a4fc9251
    • B
      Auto merge of #41768 - rap2hpoutre:patch-4, r=frewsxcv · 8aad3a35
      bors 提交于
      Add an example to std::thread::Result type
      
      This PR is a part of https://github.com/rust-lang/rust/issues/29378. I submit this PR with the help (mentoring) of @steveklabnik. I'm still not sure my request is good enough but I don't want to spoil the issue with too much questions so I continue here. r? @steveklabnik
      8aad3a35
    • B
      Auto merge of #41773 - frewsxcv:rollup, r=frewsxcv · 42a4f373
      bors 提交于
      Rollup of 9 pull requests
      
      - Successful merges: #41064, #41307, #41512, #41582, #41678, #41722, #41734, #41761, #41763
      - Failed merges:
      42a4f373
    • C
      Rollup merge of #41763 - frewsxcv:unicode-py, r=alexcrichton · 5bed9dc3
      Corey Farwell 提交于
      Move unicode Python script into libstd_unicode crate.
      
      The only place this Python script is used is inside the libstd_unicode
      crate, so lets move it there.
      5bed9dc3
    • C
      Rollup merge of #41761 - euclio:24106-test, r=estebank · 1ef0aef7
      Corey Farwell 提交于
      Add regression test for issue #24106
      
      Fixes #24106.
      1ef0aef7
    • C
      Rollup merge of #41734 - nikomatsakis:incr-comp-refactor-variance, r=pnkfelix · 26e067b0
      Corey Farwell 提交于
      Refactor variance and remove last `[pub]` map
      
      This PR refactors variance to work in a more red-green friendly way. Because red-green doesn't exist yet, it has to be a bit hacky. The basic idea is this:
      
      - We compute a big map with the variance for all items in the crate; when you request variances for a particular item, we read it from the crate
      - We now hard-code that traits are invariant (which they are, for deep reasons, not gonna' change)
      - When building constraints, we compute the transitive closure of all things within the crate that depend on what using `TransitiveRelation`
          - this lets us gin up the correct dependencies when requesting variance of a single item
      
      Ah damn, just remembered, one TODO:
      
      - [x] Update the variance README -- ah, I guess the README updates I did are sufficient
      
      r? @michaelwoerister
      26e067b0
    • C
      Rollup merge of #41722 - F001:warnTilde, r=petrochenkov · 9b2aacfd
      Corey Farwell 提交于
      Suggest `!` for bitwise negation when encountering a `~`
      
      Fix #41679
      
      Here is a program
      
      ```rust
      fn main() {
          let x = ~1;
      }
      ```
      
      It's output:
      ```
      error: `~` can not be used as an unary operator
       --> /home/fcc/temp/test.rs:4:13
        |
      4 |     let x = ~1;
        |             ^^
        |
        = help: use `!` instead of `~` if you meant to bitwise negation
      ```
      
      cc @bstrie
      9b2aacfd
    • C
      Rollup merge of #41678 - GuillaumeGomez:rustdoc-test-warnings, r=alexcrichton · ecd7b48b
      Corey Farwell 提交于
      Add option to display warnings in rustdoc
      
      Part of #41574.
      
      r? @alexcrichton
      
      The output for this file:
      
      ```rust
      /// ```
      /// fn foo(x: u32) {}
      ///
      /// foo(2);
      /// let x = 1;
      /// panic!();
      /// ```
      fn foo() {}
      
      /// ```
      /// fn foo(x: u32) {}
      ///
      /// foo(2);
      /// let x = 1;
      /// ```
      fn foo2() {}
      
      /// ```
      /// fn foo(x: u32) {}
      ///
      /// foo(2);
      /// let x = 1;
      /// panic!();
      /// ```
      fn foo3() {}
      
      fn main() {
      }
      ```
      
      is the following:
      
      ```
      > ./build/x86_64-apple-darwin/stage1/bin/rustdoc -Z unstable-options --display-warnings --test test.rs
      
      running 3 tests
      test test.rs - foo (line 1) ... FAILED
      test test.rs - foo3 (line 18) ... FAILED
      test test.rs - foo2 (line 10) ... ok
      
      successes:
      
      ---- test.rs - foo2 (line 10) stdout ----
      	warning: unused variable: `x`
       --> <anon>:2:8
        |
      2 | fn foo(x: u32) {}
        |        ^
        |
        = note: #[warn(unused_variables)] on by default
      
      warning: unused variable: `x`
       --> <anon>:5:5
        |
      5 | let x = 1;
        |     ^
        |
        = note: #[warn(unused_variables)] on by default
      
      successes:
          test.rs - foo2 (line 10)
      
      failures:
      
      ---- test.rs - foo (line 1) stdout ----
      	warning: unused variable: `x`
       --> <anon>:2:8
        |
      2 | fn foo(x: u32) {}
        |        ^
        |
        = note: #[warn(unused_variables)] on by default
      
      warning: unused variable: `x`
       --> <anon>:5:5
        |
      5 | let x = 1;
        |     ^
        |
        = note: #[warn(unused_variables)] on by default
      
      thread 'rustc' panicked at 'test executable failed:
      
      thread 'main' panicked at 'explicit panic', <anon>:6
      note: Run with `RUST_BACKTRACE=1` for a backtrace.
      
      ', src/librustdoc/test.rs:317
      note: Run with `RUST_BACKTRACE=1` for a backtrace.
      
      ---- test.rs - foo3 (line 18) stdout ----
      	warning: unused variable: `x`
       --> <anon>:2:8
        |
      2 | fn foo(x: u32) {}
        |        ^
        |
        = note: #[warn(unused_variables)] on by default
      
      warning: unused variable: `x`
       --> <anon>:5:5
        |
      5 | let x = 1;
        |     ^
        |
        = note: #[warn(unused_variables)] on by default
      
      thread 'rustc' panicked at 'test executable failed:
      
      thread 'main' panicked at 'explicit panic', <anon>:6
      note: Run with `RUST_BACKTRACE=1` for a backtrace.
      
      ', src/librustdoc/test.rs:317
      
      failures:
          test.rs - foo (line 1)
          test.rs - foo3 (line 18)
      
      test result: FAILED. 1 passed; 2 failed; 0 ignored; 0 measured
      ```
      ecd7b48b
    • C
      Rollup merge of #41582 - jonhoo:reread-nameservers-on-lookup-fail, r=alexcrichton · b091d6ed
      Corey Farwell 提交于
      Reload nameserver information on lookup failure
      
      As discussed in #41570, UNIX systems often cache the contents of `/etc/resolv.conf`, which can cause lookup failures to persist even after a network connection becomes available. This patch modifies lookup_host to force a reload of the nameserver entries following a lookup failure. This is in line with what many C programs already do (see #41570 for details). On systems with nscd, this should not be necessary, but not all systems run nscd.
      
      Fixes #41570.
      Depends on rust-lang/libc#585.
      
      r? @alexcrichton
      b091d6ed
    • C
      Rollup merge of #41512 - alexcrichton:fix-windows-tls-deadlock, r=BurntSushi · 69f4e318
      Corey Farwell 提交于
      std: Avoid locks during TLS destruction on Windows
      
      Gecko recently had a bug reported [1] with a deadlock in the Rust TLS
      implementation for Windows. TLS destructors are implemented in a sort of ad-hoc
      fashion on Windows as it doesn't natively support destructors for TLS keys. To
      work around this the runtime manages a list of TLS destructors and registers a
      hook to get run whenever a thread exits. When a thread exits it takes a look at
      the list and runs all destructors.
      
      Unfortunately it turns out that there's a lock which is held when our "at thread
      exit" callback is run. The callback then attempts to acquire a lock protecting
      the list of TLS destructors. Elsewhere in the codebase while we hold a lock over
      the TLS destructors we try to acquire the same lock held first before our
      special callback is run. And as a result, deadlock!
      
      This commit sidesteps the issue with a few small refactorings:
      
      * Removed support for destroying a TLS key on Windows. We don't actually ever
        exercise this as a public-facing API, and it's only used during `lazy_init`
        during racy situations. To handle that we just synchronize `lazy_init`
        globally on Windows so we never have to call `destroy`.
      
      * With no need to support removal the global synchronized `Vec` was tranformed
        to a lock-free linked list. With the removal of locks this means that
        iteration no long requires a lock and as such we won't run into the deadlock
        problem mentioned above.
      
      Note that it's still a general problem that you have to be extra super careful
      in TLS destructors. For example no code which runs a TLS destructor on Windows
      can call back into the Windows API to do a dynamic library lookup. Unfortunately
      I don't know of a great way around that, but this at least fixes the immediate
      problem that Gecko was seeing which is that with "well behaved" destructors the
      system would still deadlock!
      
      [1]: https://bugzilla.mozilla.org/show_bug.cgi?id=1358151
      69f4e318
    • C
      Rollup merge of #41307 - GuillaumeGomez:jquery-removal, r=frewsxcv · 31a4d73e
      Corey Farwell 提交于
      Remove jquery dependency
      
      r? @rust-lang/docs
      
      Fixes #39159.
      31a4d73e
    • C
      Rollup merge of #41064 - Gankro:ptr-redux, r=alexcrichton · 6ace8a76
      Corey Farwell 提交于
      refactor NonZero, Shared, and Unique APIs
      
      Major difference is that I removed Deref impls, as apparently LLVM has
      trouble maintaining metadata with a `&ptr -> &ptr` API. This was cited
      as a blocker for ever stabilizing this API. It wasn't that ergonomic
      anyway.
      
      * Added `get` to NonZero to replace Deref impl
      * Added `ptr` getter to Shared/Unique to replace Deref impl
      * Added Unique's `get` and `get_mut` conveniences to Shared
      * Deprecated `as_mut_ptr` on Shared in favour of `ptr`
      
      Note that Shared used to primarily expose only `*const` but there isn't
      a good justification for that, so I made it `*mut`.
      6ace8a76
    • B
      Auto merge of #41769 - alexcrichton:fix-doc-test, r=aturon · f4209651
      bors 提交于
      std: Prevent deadlocks in doctests on Windows
      
      Windows historically has problems with threads panicking and the main thread
      exiting at the same time, typically causing deadlocks. In the past (#25824)
      we've joined on threads but this just prevents running the test for now to avoid
      tampering with the example.
      f4209651
    • N
      3da5daf4
    • A
      std: Prevent deadlocks in doctests on Windows · 94e4b459
      Alex Crichton 提交于
      Windows historically has problems with threads panicking and the main thread
      exiting at the same time, typically causing deadlocks. In the past (#25824)
      we've joined on threads but this just prevents running the test for now to avoid
      tampering with the example.
      94e4b459
    • B
      Auto merge of #41765 - brson:installer, r=alexcrichton · 302dfd6c
      bors 提交于
      Update rust-installer to fix rust-lang-nursery/rustup.rs#1092
      
      r? @TimNN
      
      cc @alexcrichton @ranma42
      302dfd6c
  4. 05 5月, 2017 1 次提交
    • A
      std: Avoid locks during TLS destruction on Windows · 495c9985
      Alex Crichton 提交于
      Gecko recently had a bug reported [1] with a deadlock in the Rust TLS
      implementation for Windows. TLS destructors are implemented in a sort of ad-hoc
      fashion on Windows as it doesn't natively support destructors for TLS keys. To
      work around this the runtime manages a list of TLS destructors and registers a
      hook to get run whenever a thread exits. When a thread exits it takes a look at
      the list and runs all destructors.
      
      Unfortunately it turns out that there's a lock which is held when our "at thread
      exit" callback is run. The callback then attempts to acquire a lock protecting
      the list of TLS destructors. Elsewhere in the codebase while we hold a lock over
      the TLS destructors we try to acquire the same lock held first before our
      special callback is run. And as a result, deadlock!
      
      This commit sidesteps the issue with a few small refactorings:
      
      * Removed support for destroying a TLS key on Windows. We don't actually ever
        exercise this as a public-facing API, and it's only used during `lazy_init`
        during racy situations. To handle that we just synchronize `lazy_init`
        globally on Windows so we never have to call `destroy`.
      
      * With no need to support removal the global synchronized `Vec` was tranformed
        to a lock-free linked list. With the removal of locks this means that
        iteration no long requires a lock and as such we won't run into the deadlock
        problem mentioned above.
      
      Note that it's still a general problem that you have to be extra super careful
      in TLS destructors. For example no code which runs a TLS destructor on Windows
      can call back into the Windows API to do a dynamic library lookup. Unfortunately
      I don't know of a great way around that, but this at least fixes the immediate
      problem that Gecko was seeing which is that with "well behaved" destructors the
      system would still deadlock!
      
      [1]: https://bugzilla.mozilla.org/show_bug.cgi?id=1358151
      495c9985