Permalink
Commits on Jan 10, 2017
  1. Auto merge of #38138 - rkruppe:no_std-no_loop, r=steveklabnik

    book: use abort() over loop {} for panic
    
    Due to #28728 `loop {}` is very risky and can lead to fun debugging experiences such as #38136. Besides, aborting is probably better behavior than an infinite loop.
    
    r? @steveklabnik
    bors committed Jan 10, 2017
  2. Auto merge of #38947 - nrc:custom-derive-span, r=jseyfried

    Give custom derive spans an expansion ID
    
    r? @jseyfried
    bors committed Jan 10, 2017
  3. Auto merge of #38934 - Manishearth:nodrop, r=eddyb

    Remove destructor-related restrictions from unions
    
    They don't have drop glue.
    
    This doesn't fix the rvalue promotion issues when trying to do things like `static FOO: NoDrop<Bar> = NoDrop {inner: Bar}`. I'm not sure if we should fix that.
    bors committed Jan 10, 2017
  4. Give custom derive spans an expansion ID

    nrc committed Jan 9, 2017
Commits on Jan 9, 2017
  1. Auto merge of #38937 - nrc:save-ty-fix, r=nikomatsakis

    save-analysis: fix over-zealous filter on generated code
    bors committed Jan 9, 2017
  2. Auto merge of #38244 - estebank:escape-reason-docs, r=ollie27

    rustdoc: escape the deprecated and unstable reason text
    
    Fix #38220.
    Instead of the [current output](https://doc.rust-lang.org/std/boxed/trait.FnBox.html):
    
    <img width="967" alt="incorrect unescaped unstable reason in docs" src="https://cloud.githubusercontent.com/assets/1606434/21021898/73121d42-bd2f-11e6-8076-8a5127dbc010.png">
    
    display:
    
    <img width="979" alt="escaped unstable reason in docs" src="https://cloud.githubusercontent.com/assets/1606434/21021876/52eb0f88-bd2f-11e6-9088-58bdc7d92328.png">
    bors committed Jan 9, 2017
  3. Make unions never have needs_drop

    Manishearth committed Jan 9, 2017
  4. Auto merge of #38581 - frewsxcv:vecdequeue-insert, r=GuillaumeGomez

    Clarify behavior of `VecDeque::insert`.
    
    Fixes #37046.
    bors committed Jan 9, 2017
  5. Auto merge of #38310 - frewsxcv:ctlz-cttz, r=pnkfelix

    Clarify zero-value behavior of `ctlz`/`cttz` intrinsics.
    
    Fixes #34381.
    bors committed Jan 9, 2017
  6. Auto merge of #38929 - Manishearth:compiler-docs, r=alexcrichton

    Don't restrict docs in compiler-docs mode
    
    Search is broken without this. We want all crates to be included in compiler-docs mode. This was changed in #38858, this PR brings that functionality back in compiler-docs mode.
    bors committed Jan 9, 2017
  7. Auto merge of #38923 - petrochenkov:scheck, r=alexcrichton

    Avoid large number of stage 0 warnings about --no-stack-check
    
    ```
    ....
    
    rustc: x86_64-pc-windows-gnu/stage0/lib/rustlib/x86_64-pc-windows-gnu/lib/libstd
    warning: the --no-stack-check flag is deprecated and does nothing
    
    rustc: x86_64-pc-windows-gnu/stage0/lib/rustlib/x86_64-pc-windows-gnu/lib/libgetopts
    warning: the --no-stack-check flag is deprecated and does nothing
    
    rustc: x86_64-pc-windows-gnu/stage0/lib/rustlib/x86_64-pc-windows-gnu/lib/libterm
    warning: the --no-stack-check flag is deprecated and does nothing
    
    rustc: x86_64-pc-windows-gnu/stage0/lib/rustlib/x86_64-pc-windows-gnu/lib/liblog
    warning: the --no-stack-check flag is deprecated and does nothing
    
    ....
    ```
    
    r? @alexcrichton
    bors committed Jan 9, 2017
  8. Auto merge of #38866 - alexcrichton:try-wait, r=aturon

    std: Add a nonblocking `Child::try_wait` method
    
    This commit adds a new method to the `Child` type in the `std::process` module
    called `try_wait`. This method is the same as `wait` except that it will not
    block the calling thread and instead only attempt to collect the exit status. On
    Unix this means that we call `waitpid` with the `WNOHANG` flag and on Windows it
    just means that we pass a 0 timeout to `WaitForSingleObject`.
    
    Currently it's possible to build this method out of tree, but it's unfortunately
    tricky to do so. Specifically on Unix you essentially lose ownership of the pid
    for the process once a call to `waitpid` has succeeded. Although `Child` tracks
    this state internally to be resilient to multiple calls to `wait` or a `kill`
    after a successful wait, if the child is waited on externally then the state
    inside of `Child` is not updated. This means that external implementations of
    this method must be extra careful to essentially not use a `Child`'s methods
    after a call to `waitpid` has succeeded (even in a nonblocking fashion).
    
    By adding this functionality to the standard library it should help canonicalize
    these external implementations and ensure they can continue to robustly reuse
    the `Child` type from the standard library without worrying about pid ownership.
    bors committed Jan 9, 2017
  9. Auto merge of #38840 - kjaleshire:multiple-targets-error-fix, r=nrc

    Warn that the link target ignores the given name
    
    Hi, new contributor here. This is my stab at #20130, any feedback welcome!
    bors committed Jan 9, 2017
  10. Don't restrict docs in compiler-docs mode

    Manishearth committed Jan 8, 2017
  11. Auto merge of #38910 - steveklabnik:update_docs, r=eddyb

    Improve safety warning on ptr::swap
    
    r? @eddyb @bluss , who I asked about this on IRC
    bors committed Jan 9, 2017
  12. save-analysis: fix over-zealous filter on generated code

    nrc committed Jan 9, 2017
  13. Auto merge of #38907 - alexcrichton:curl-retry, r=japaric

    rustbuild: Pass --retry 3 to curl
    
    Try to handle spurious network failures on Travis by automatically
    retrying failed downloads on Travis.
    bors committed Jan 9, 2017
Commits on Jan 8, 2017
  1. Auto merge of #38904 - alexcrichton:travis-retry, r=japaric

    travis: Wrap submodules updates in travis_retry
    
    Let's try to squash some of those network issues with a `travis_retry`
    tool to just retry the command a few times.
    bors committed Jan 8, 2017
  2. Auto merge of #38861 - est31:master, r=alexcrichton

    Make members of {std,core}::{i128,u128} unstable
    
    Fixes #38860
    bors committed Jan 8, 2017
  3. Auto merge of #38853 - alexcrichton:better-dist, r=brson

    rustbuild: Don't build target compilers in stage0
    
    The `doc-book` and `doc-nomicon` steps accidentally depended on a rustbook
    compiled by a cross-compiled compiler, which isn't necessary. Be sure to set the
    `host` on these dependency edges to the build compiler to ensure that we're
    always using a tool compiled for the host platform.
    
    This was discovered trawling the build logs for the new dist bots and
    discovering that they're building one too many compilers in stage0.
    bors committed Jan 8, 2017
  4. Auto merge of #38837 - eddyb:issue-38074, r=nikomatsakis

    Allow projections to be promoted to constants in MIR.
    
    This employs the `LvalueContext` additions by @pcwalton to properly extend the MIR promotion of temporaries to allow projections (field accesses, indexing and dereferences) on said temporaries.
    
    It's needed both parity with the old constant qualification logic (for current borrowck) and it fixes #38074.
    The former is *required for soundness* if we accept the RFC for promoting rvalues to `'static` constants.
    That is, until we get MIR borrowck and the same source of truth will be used for both checks and codegen.
    bors committed Jan 8, 2017
  5. Auto merge of #38797 - abhijeetbhagat:master, r=petrochenkov

    Fix process module tests to run on Windows
    
    Fixes #38565
    r? @retep998
    bors committed Jan 8, 2017
  6. Avoid large number of stage 0 warnings about --no-stack-check

    petrochenkov committed Jan 8, 2017
  7. Auto merge of #38813 - eddyb:lazy-11, r=nikomatsakis

    [11/n] Separate ty::Tables into one per each body.
    
    _This is part of a series ([prev](#38449) | [next]()) of patches designed to rework rustc into an out-of-order on-demand pipeline model for both better feature support (e.g. [MIR-based](https://github.com/solson/miri) early constant evaluation) and incremental execution of compiler passes (e.g. type-checking), with beneficial consequences to IDE support as well.
    If any motivation is unclear, please ask for additional PR description clarifications or code comments._
    
    <hr>
    
    In order to track the results of type-checking and inference for incremental recompilation, they must be stored separately for each function or constant value, instead of lumped together.
    
    These side-`Tables` also have to be tracked by various passes, as they visit through bodies (all of which have `Tables`, even if closures share the ones from their parent functions). This is usually done by switching a `tables` field in an override of `visit_nested_body` before recursing through `visit_body`, to the relevant one and then restoring it - however, in many cases the nesting is unnecessary and creating the visitor for each body in the crate and then visiting that body, would be a much cleaner solution.
    
    To simplify handling of inlined HIR & its side-tables, their `NodeId` remapping and entries HIR map were fully stripped out, which means that `NodeId`s from inlined HIR must not be used where a local `NodeId` is expected. It might be possible to make the nodes (`Expr`, `Block`, `Pat`, etc.) that only show up within a `Body` have IDs that are scoped to that `Body`, which would also allow `Tables` to use `Vec`s.
    
    That last part also fixes #38790 which was accidentally introduced in a previous refactor.
    bors committed Jan 8, 2017
  8. Auto merge of #38679 - alexcrichton:always-deny-warnings, r=nrc

    Remove not(stage0) from deny(warnings)
    
    Historically this was done to accommodate bugs in lints, but there hasn't been a
    bug in a lint since this feature was added which the warnings affected. Let's
    completely purge warnings from all our stages by denying warnings in all stages.
    This will also assist in tracking down `stage0` code to be removed whenever
    we're updating the bootstrap compiler.
    bors committed Jan 8, 2017
  9. Auto merge of #38883 - alexcrichton:android-flaky, r=brson

    compiletest: Fix flaky Android gdb test runs
    
    Local testing showed that I was able to reproduce an error where debuginfo tests
    on Android would fail with "connection reset by peer". Further investigation
    turned out that the gdb tests are android with bit of process management:
    
    * First an `adb forward` command is run to ensure that the host's port 5039 is
      the same as the emulator's.
    * Next an `adb shell` command is run to execute the `gdbserver` executable
      inside the emulator. This gdb server will attach to port 5039 and listen for
      remote gdb debugging sessions.
    * Finally, we run `gdb` on the host (not in the emulator) and then connect to
      this gdb server to send it commands.
    
    The problem was happening when the host's gdb was failing to connect to the
    remote gdbserver running inside the emulator. The previous test for this was
    that after `adb shell` executed we'd sleep for a second and then attempt to make
    a TCP connection to port 5039. If successful we'd run gdb and on failure we'd
    sleep again.
    
    It turns out, however, that as soon as we've executed `adb forward` all TCP
    connections to 5039 will succeed. This means that we would only ever sleep for
    at most one second, and if this wasn't enough time we'd just fail later because
    we would assume that gdbserver had started but it may not have done so yet.
    
    This commit fixes these issues by removing the TCP connection to test if
    gdbserver is ready to go. Instead we read the stdout of the process and wait for
    it to print that it's listening at which point we start running gdb. I've found
    that locally at least I was unable to reproduce the failure after these changes.
    
    Closes #38710
    bors committed Jan 8, 2017
  10. Auto merge of #38822 - michaelwoerister:collect-fn-once-adapter, r=eddyb

    trans: Fix missing closure env drop-glue in trans-item collector.
    
    FnOnce adapters automatically generated by the compiler introduce a call to drop the closure environment. The collector didn't pick up on that because this drop call does not show up in MIR. That could lead to an assertion being triggered if the drop-glue for the environment wasn't instantiated via something else.
    
    Fixes #38810
    
    cc @arielb1
    
    r? @eddyb or @nikomatsakis
    bors committed Jan 8, 2017
  11. Auto merge of #38807 - comex:pprint-expr-attr, r=nrc

    Print attributes on expressions when pretty printing.
    
    Test case: `rustc -Z unstable-options --unpretty=hir <(echo 'fn main() { #[allow()] main() }')`
    bors committed Jan 8, 2017
  12. Auto merge of #38798 - jsgf:fix-rpath, r=nikomatsakis

    rustc: use -Xlinker when specifying an rpath with ',' in it
    
    The `-Wl` option splits its parameters on commas, so if rustc specifies
    `-Wl,-rpath,<path>` when `<path>` contains commas, the path gets split up
    and the linker gets a partial path and spurious extra parameters.
    
    Gcc/clang support the more verbose `-Xlinker` option to pass options to the linker directly, so use it for comma-containing paths.
    
    Fixes issue #38795.
    bors committed Jan 8, 2017
Commits on Jan 7, 2017
  1. Auto merge of #38781 - SimonSapin:unishrink, r=alexcrichton

    Reduce the size of static data in std_unicode::tables
    
    `BoolTrie` works well for sets of code points spread out through most of Unicode’s range, but is uses a lot of space for sets with few, mostly low, code points.
    
    This switches a few of its instances to a similar but simpler trie data structure.
    
    CC @raphlinus, who wrote the original `BoolTrie`.
    
    ## Before
    
    `size_of::<BoolTrie>()` is 1552, which is added to `table.r3.len() * 8 + t.r5.len() + t.r6.len() * 8`:
    
    * `Cc_table`: 1632
    * `White_Space_table`: 1656
    * `Pattern_White_Space_table`: 1640
    * Total: 4928 bytes
    
    ## After
    
    `size_of::<SmallBoolTrie>()` is 32, which is added to `t.r1.len() + t.r2.len() * 8`:
    
    * `Cc_table`: 51
    * `White_Space_table`: 273
    * `Pattern_White_Space_table`: 193
    * Total: 517 bytes
    
    ## Difference
    
    Every Rust program with `std` statically linked should be about 4 KB smaller.
    bors committed Jan 7, 2017
  2. thanks @eddyb

    steveklabnik committed Jan 7, 2017
  3. Auto merge of #38733 - sfackler:peek-mut-pop, r=alexcrichton

    Add PeekMut::pop
    
    A fairly common workflow is to put a bunch of stuff into a binary heap
    and then mutate the top value until its empty. This both makes that a
    bit more convenient (no need to save a boolean off and pop after to
    avoid borrowck issues), and a bit more efficient since you only shift
    once.
    
    r? @alexcrichton
    
    cc @rust-lang/libs
    bors committed Jan 7, 2017
  4. rustbuild: Pass --retry 3 to curl

    Try to handle spurious network failures on Travis by automatically
    retrying failed downloads on Travis.
    alexcrichton committed Jan 7, 2017
  5. Auto merge of #38551 - aidanhs:aphs-vec-in-place, r=brson

    Implement placement-in protocol for `Vec`
    
    Follow-up of #32366 per comment at #30172 (comment), updating to latest rust, leaving @apasel422 as author and putting myself as committer.
    
    I've removed the implementation of `push` in terms of place to make this PR more conservative.
    bors committed Jan 7, 2017