Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rollup of 17 pull requests #37581

Closed
wants to merge 50 commits into from
Closed

Rollup of 17 pull requests #37581

wants to merge 50 commits into from

Commits on Oct 18, 2016

  1. Fix some mistakes in HRTB docs

    The example code for higher-ranked trait bounds on closures had an
    unnecessary `mut` which was confusing, and the text referred to an
    mutable reference which does not exist in the code (and isn't needed).
    Removed the `mut`s and fixed the text to better describe the actual
    error for the failing example.
    mbrubeck committed Oct 18, 2016
    Configuration menu
    Copy the full SHA
    f89ba5d View commit details
    Browse the repository at this point in the history

Commits on Oct 20, 2016

  1. Configuration menu
    Copy the full SHA
    9ae9930 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    4955711 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    69b9400 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    a3cab90 View commit details
    Browse the repository at this point in the history

Commits on Oct 21, 2016

  1. Add release notes for 1.12.1

    brson committed Oct 21, 2016
    Configuration menu
    Copy the full SHA
    e47da0c View commit details
    Browse the repository at this point in the history
  2. vec: Use Vec::extend specializations in extend_from_slice and more

    The new Vec::extend covers the duties of .extend_from_slice() and some
    previous specializations.
    bluss committed Oct 21, 2016
    Configuration menu
    Copy the full SHA
    622f24f View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    ee84ec1 View commit details
    Browse the repository at this point in the history

Commits on Oct 23, 2016

  1. Configuration menu
    Copy the full SHA
    f69cd1b View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    df0e5a9 View commit details
    Browse the repository at this point in the history

Commits on Oct 26, 2016

  1. core::ptr: Add .wrapping_offset() methods

    .wrapping_offset() exposes the arith_offset intrinsic in the core
    module. This is the first step in making it possible to stabilize the
    interface later.
    
    `arith_offset` is a useful tool for developing iterators for two
    reasons:
    
    1. `arith_offset` is used by the slice's iterator, the most important
       iterator in libcore, and it is natural that Rust users need the same
       power available to implement similar iterators.
    2. It is a good way to implement raw pointer iterations with step
       greater than one.
    
    The name seems to fit the style of methods like "wrapping_add".
    bluss committed Oct 26, 2016
    Configuration menu
    Copy the full SHA
    8b2108c View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    2411be5 View commit details
    Browse the repository at this point in the history
  3. vec: Remove the Vec specialization for .extend()

    This now produces as good code (with optimizations) using the TrustedLen
    codepath.
    bluss committed Oct 26, 2016
    Configuration menu
    Copy the full SHA
    5dc9db5 View commit details
    Browse the repository at this point in the history

Commits on Oct 31, 2016

  1. rustc: Add knowledge of Windows subsystems.

    This commit is an implementation of [RFC 1665] which adds support for the
    `#![windows_subsystem]` attribute. This attribute allows specifying either the
    "windows" or "console" subsystems on Windows to the linker.
    
    [RFC 1665]: https://github.com/rust-lang/rfcs/blob/master/text/1665-windows-subsystem.md
    
    Previously all Rust executables were compiled as the "console" subsystem which
    meant that if you wanted a graphical application it would erroneously pop up a
    console whenever opened. When compiling an application, however, this is
    undesired behavior and the "windows" subsystem is used instead to have control
    over user interactions.
    
    This attribute is validated, but ignored on all non-Windows platforms.
    
    cc rust-lang#37499
    alexcrichton committed Oct 31, 2016
    Configuration menu
    Copy the full SHA
    20c3013 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    eba93c3 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    9253e12 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    6554fb0 View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    dce4600 View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    5cb5c85 View commit details
    Browse the repository at this point in the history
  7. Configuration menu
    Copy the full SHA
    f7107f3 View commit details
    Browse the repository at this point in the history

Commits on Nov 2, 2016

  1. Configuration menu
    Copy the full SHA
    c8578db View commit details
    Browse the repository at this point in the history
  2. Don't hash span filenames twice in IchHasher.

    This significantly reduces the number of bytes hashed by IchHasher.
    nnethercote committed Nov 2, 2016
    Configuration menu
    Copy the full SHA
    af0b27e View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    942f909 View commit details
    Browse the repository at this point in the history
  4. leb128-encode integers before hashing them in IchHasher.

    This significantly reduces the number of bytes hashed by IchHasher.
    nnethercote committed Nov 2, 2016
    Configuration menu
    Copy the full SHA
    d73c68c View commit details
    Browse the repository at this point in the history

Commits on Nov 3, 2016

  1. set frame pointer elimination attribute for main

    The rustc-generated function `main` should respect the same config for
    frame pointer elimination as the rest of code.
    dinfuehr committed Nov 3, 2016
    Configuration menu
    Copy the full SHA
    7d06bdd View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    dc138b3 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    ed0230e View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    d5f72d2 View commit details
    Browse the repository at this point in the history
  5. Set RUSTC_BOOTSTRAP to some value.

    Environment variables on windows can't be empty.
    brson committed Nov 3, 2016
    Configuration menu
    Copy the full SHA
    6a34feb View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    67626e0 View commit details
    Browse the repository at this point in the history

Commits on Nov 4, 2016

  1. Configuration menu
    Copy the full SHA
    f0e6b90 View commit details
    Browse the repository at this point in the history
  2. Reorder hir::Expr fields.

    On 64-bit platforms this reduces the size of `Expr` from 96 bytes to 88
    bytes.
    nnethercote committed Nov 4, 2016
    Configuration menu
    Copy the full SHA
    9366ba3 View commit details
    Browse the repository at this point in the history
  3. Shrink Expr_::ExprStruct.

    On 64-bit platforms this reduces the size of `Expr_` from  64 bytes to
    56 bytes, and reduces the size of `Expr` from 88 bytes to 80 bytes.
    nnethercote committed Nov 4, 2016
    Configuration menu
    Copy the full SHA
    43452a3 View commit details
    Browse the repository at this point in the history
  4. Rollup merge of rust-lang#37255 - mbrubeck:doc-edit, r=steveklabnik

    Fix some mistakes in HRTB docs
    
    The example code for higher-ranked trait bounds on closures had an unnecessary `mut` which was confusing, and the text referred to an mutable reference which does not exist in the code (and isn't needed).  Removed the `mut`s and fixed the text to better describe the actual error for the failing example.
    
    Thanks to csd_ on IRC for pointing out these problems!
    
    r? @steveklabnik
    Jonathan Turner authored Nov 4, 2016
    Configuration menu
    Copy the full SHA
    776e4ed View commit details
    Browse the repository at this point in the history
  5. Rollup merge of rust-lang#37306 - bluss:trusted-len, r=alexcrichton

    Add Iterator trait TrustedLen to enable better FromIterator / Extend
    
    This trait attempts to improve FromIterator / Extend code by enabling it to trust the iterator to produce an exact number of elements, which means that reallocation needs to happen only once and is moved out of the loop.
    
    `TrustedLen` differs from `ExactSizeIterator` in that it attempts to include _more_ iterators by allowing for the case that the iterator's len does not fit in `usize`. Consumers must check for this case (for example they could panic, since they can't allocate a collection of that size).
    
    For example, chain can be TrustedLen and all numerical ranges can be TrustedLen. All they need to do is to report an exact size if it fits in `usize`, and `None` as the upper bound otherwise.
    
    The trait describes its contract like this:
    
    ```
    An iterator that reports an accurate length using size_hint.
    
    The iterator reports a size hint where it is either exact
    (lower bound is equal to upper bound), or the upper bound is `None`.
    The upper bound must only be `None` if the actual iterator length is
    larger than `usize::MAX`.
    
    The iterator must produce exactly the number of elements it reported.
    
    This trait must only be implemented when the contract is upheld.
    Consumers of this trait must inspect `.size_hint()`’s upper bound.
    ```
    
    Fixes rust-lang#37232
    Jonathan Turner authored Nov 4, 2016
    Configuration menu
    Copy the full SHA
    74de6eb View commit details
    Browse the repository at this point in the history
  6. Rollup merge of rust-lang#37317 - brson:relnotes, r=brson

    Add release notes for 1.12.1
    
    It completely slipped my mind that this is something I'm supposed to do as part of the release process...
    Jonathan Turner authored Nov 4, 2016
    Configuration menu
    Copy the full SHA
    d3ff61f View commit details
    Browse the repository at this point in the history
  7. Rollup merge of rust-lang#37356 - cristicbz:wrapsum, r=alexcrichton

    Add impls for `&Wrapping`. Also `Sum`, `Product` impls for both `Wrapping` and `&Wrapping`.
    
    There are two changes here (split into two commits):
    - Ops for references to `&Wrapping`  (`Add`, `Sub`, `Mul` etc.) similar to the way they are implemented for primitives.
    - Impls for `iter::{Sum,Product}` for `Wrapping`.
    
    As far as I know `impl` stability attributes don't really matter so I didn't bother breaking up the macro for two different kinds of stability. Happy to change if it does matter.
    Jonathan Turner authored Nov 4, 2016
    Configuration menu
    Copy the full SHA
    5714cd2 View commit details
    Browse the repository at this point in the history
  8. Rollup merge of rust-lang#37402 - eddyb:lazy-3, r=nikomatsakis

    [3/n] rustc: unify and simplify managing associated items.
    
    _This is part of a series ([prev](rust-lang#37401) | [next](rust-lang#37404)) 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>
    
    `ImplOrTraitItem`/`impl_or_trait_item` have been renamed to `AssociatedItem`/`associated_item`.
    
    The common fields from (what used to be) `ty::ImplOrTraitItem`'s variants have been pulled out, leaving only an `AssociatedKind` C-like enum to distinguish between methods, constants and types.
    
    The type information has been removed from `AssociatedItem`, and as such the latter can now be computed on-demand from the local HIR map, i.e. an extern-crate-enabled `TraitItem | ImplItem`.
    It may be moved to HIR in the future, if we intend to start using HIR types cross-crate.
    
    `ty::ExplicitSelfCategory` has been moved to `rustc_typeck` and is produced on-demand from the signature of the method, and a `method_has_self_argument` field on `AssociatedItem`, which is used to indicate that the first argument is a sugary "method receiver" and as such, method call syntax can be used.
    Jonathan Turner authored Nov 4, 2016
    Configuration menu
    Copy the full SHA
    2f98448 View commit details
    Browse the repository at this point in the history
  9. Rollup merge of rust-lang#37410 - TimNN:gdb-next-gen, r=alexcrichton

    Support GDB with native rust support
    
    This PR aims at making the debuginfo tests pass with the newer GDB versions which have native rust support (RGDB)
    
    To that end debuginfo tests now support three GDB prefixes:
    - `gdb` applicable to both GDB varieties
    - `gdbg` (**G**eneric) only applicable to the old GDB
    - `gdbr` (**R**ust) only applicable to the new RGDB
    
    Whether the GDB has rust support is detected based on it's version: GDB >= 7.11.10 is considered to have rust support.
    
    ---
    
    **Test updates**
    
    All tests have been updated to the new GDB version. Note that some tests currently require the GDB trunk<sup>1</sup>.
    
    ---
    
    **How to move forward with this PR:**
    
    I propose the following steps for moving forward with this PR:
    - [x] Validate the general approach of this PR (the `gdb-`, `gdbg-` and `gdbr-` split)
    - [x] Validate the approach taken for updating the debuginfo tests (I've checked this since there's (almost) no `set language c` left, which was my main concern)
    - [x] Determine how to distinguish between the new and old GDB (and implement that)
    - [ ] Add one or more non-gating build bots with the new GDB (blocked on the previous item, can happen after this PR has been merged)
    - [ ] If the new bots pass the tests, gate on them
    - [x] \(Maybe) update the remaining tests to run without `set syntax c` (in a separate PR)
    - [ ] \(Maybe) add tests specifically for the new GDB (in a separate PR / open an issue about this)
    
    I'm not completely sure about the build bot related steps (cc @alexcrichton), the current approach was suggested to prevent any downtime / broken build time between a new GDB gating builder being added and this PR being merged.
    
    ---
    
    **Suboptimal RGDB Output**
    
    I've found several places where the output of RGDB is not ideal. They are tagged with `// FIXME`, here is an overview:
    - [x] Trait references are not syntactically correct: `type_names::&Trait2<...>` (**WontFix**: the issue is minor and from @Manishearth below: "to properly address the trait issue we should wait for trait object support")
    - [x] Univariant enums are printed as `<error reading variable>` (**Fixed** in GDB trunk<sup>1<sup>)
    - [x] Unions are printed as `<error reading variable>` (**Fixed** in GDB trunk<sup>1</sup>)
    - [x] "Nil Enums" (`enum Foo {}`) are printed as `<error reading variable>` (**WontFix**: the are not supposed to exist)
    - [x] I have found no alternative for `sizeof(var)` in rust mode, so had to resort to `set language c` (**Fixed** in GDB trunk<sup>1</sup>)
    - [x] I have found not way of interpreting a value as a specific enum variant, so had to resort to `set language c` (**Fixed** in GDB trunk<sup>1</sup>)
    - [x] Before the initial `run` command, gdb does not realise it should be in rust mode (thus, if one want's to print statics before the run one has to explicitly `set language rust`) (maybe this is intended / expected behaviour, if so, someone please tell me ;) (**"Expected"** / current behaviour of GDB: picks up jemalloc, see rust-lang#37410 (comment))
    
    <sup>1</sup>: Or rather in @Manishearth's trunk, waiting to be merged upstream.
    
    ---
    
    cc @alexcrichton, @michaelwoerister, rust-lang#36323
    Jonathan Turner authored Nov 4, 2016
    Configuration menu
    Copy the full SHA
    0538044 View commit details
    Browse the repository at this point in the history
  10. Rollup merge of rust-lang#37422 - bluss:wrapping-offset, r=alexcrichton

    Add .wrapping_offset() methods
    
    .wrapping_offset() exposes the arith_offset intrinsic in the core
    module (as methods on raw pointers, next to offset). This is the
    first step in making it possible to stabilize the interface later.
    
    `arith_offset` is a useful tool for developing iterators for two
    reasons:
    1. `arith_offset` is used by the slice's iterator, the most important
       iterator in libcore, and it is natural that Rust users need the same
       power available to implement similar iterators.
    2. It is a good way to implement raw pointer iterations with step
       greater than one.
    
    The name seems to fit the style of methods like "wrapping_add".
    Jonathan Turner authored Nov 4, 2016
    Configuration menu
    Copy the full SHA
    a267214 View commit details
    Browse the repository at this point in the history
  11. Rollup merge of rust-lang#37427 - nnethercote:opt-IchHasher, r=michae…

    …lwoerister
    
    Reduce the number of bytes hashed by IchHasher.
    
    IchHasher uses blake2b hashing, which is expensive, so the fewer bytes hashed
    the better. There are two big ways to reduce the number of bytes hashed.
    - Filenames in spans account for ~66% of all bytes (for builds with debuginfo).
      The vast majority of spans have the same filename for the start of the span
      and the end of the span, so hashing the filename just once in those cases is
      a big win.
    - u32 and u64 and usize values account for ~25%--33% of all bytes (for builds
      with debuginfo). The vast majority of these are small, i.e. fit in a u8, so
      shrinking them down before hashing is also a big win.
    
    This PR implements these two optimizations. I'm certain the first one is safe.
    I'm about 90% sure that the second one is safe.
    
    Here are measurements of the number of bytes hashed when doing
    debuginfo-enabled builds of stdlib and
    rustc-benchmarks/syntex-0.42.2-incr-clean.
    
    ```
                        stdlib   syntex-incr
                        ------   -----------
    original       156,781,386   255,095,596
    half-SawSpan   106,744,403   176,345,419
    short-ints      45,890,534   118,014,227
    no-SawSpan[*]    6,831,874    45,875,714
    
    [*] don't hash the SawSpan at all. Not part of this PR, just implemented for
        comparison's sake.
    ```
    
    For debug builds of syntex-0.42.2-incr-clean, the two changes give a 1--2%
    speed-up.
    Jonathan Turner authored Nov 4, 2016
    Configuration menu
    Copy the full SHA
    e5ebb60 View commit details
    Browse the repository at this point in the history
  12. Rollup merge of rust-lang#37470 - arthurprs:sip-smaller, r=alexcrichton

    Don't reuse RandomState seeds
    
    cc rust-lang#36481
    Jonathan Turner authored Nov 4, 2016
    Configuration menu
    Copy the full SHA
    7e6799d View commit details
    Browse the repository at this point in the history
  13. Rollup merge of rust-lang#37501 - alexcrichton:windows-subsystem, r=b…

    …rson
    
    rustc: Add knowledge of Windows subsystems.
    
    This commit is an implementation of [RFC 1665] which adds support for the
    `#![windows_subsystem]` attribute. This attribute allows specifying either the
    "windows" or "console" subsystems on Windows to the linker.
    
    [RFC 1665]: https://github.com/rust-lang/rfcs/blob/master/text/1665-windows-subsystem.md
    
    Previously all Rust executables were compiled as the "console" subsystem which
    meant that if you wanted a graphical application it would erroneously pop up a
    console whenever opened. When compiling an application, however, this is
    undesired behavior and the "windows" subsystem is used instead to have control
    over user interactions.
    
    This attribute is validated, but ignored on all non-Windows platforms.
    
    cc rust-lang#37499
    Jonathan Turner authored Nov 4, 2016
    Configuration menu
    Copy the full SHA
    f625f74 View commit details
    Browse the repository at this point in the history
  14. Rollup merge of rust-lang#37537 - GuillaumeGomez:error_kind_doc, r=st…

    …eveklabnik
    
    Add missing urls for ErrorKind's variants
    
    r? @steveklabnik
    Jonathan Turner authored Nov 4, 2016
    Configuration menu
    Copy the full SHA
    c5752f0 View commit details
    Browse the repository at this point in the history
  15. Rollup merge of rust-lang#37556 - dinfuehr:main_frame_pointer, r=eddyb

    set frame pointer elimination attribute for main
    
    The rustc-generated function `main` should respect the same config for
    frame pointer elimination as the rest of code.
    Jonathan Turner authored Nov 4, 2016
    Configuration menu
    Copy the full SHA
    be98e20 View commit details
    Browse the repository at this point in the history
  16. Rollup merge of rust-lang#37557 - TimNN:fix-36954, r=eddyb

    Use DefId's in const eval for cross-crate const fn's
    
    Fixes rust-lang#36954.
    
    r? @eddyb
    
    cc @raphaelcohn
    Jonathan Turner authored Nov 4, 2016
    Configuration menu
    Copy the full SHA
    fbcb057 View commit details
    Browse the repository at this point in the history
  17. Rollup merge of rust-lang#37564 - Mark-Simulacrum:sized-ice, r=eddyb

    Fix ICE when querying DefId on Def::Err.
    
    Also moves computations into check that `kind_id` is `Ok(_)`, which is in theory an optimization, though I expect it's minor.
    
    Fixes rust-lang#37534.
    
    r? @eddyb.
    Jonathan Turner authored Nov 4, 2016
    Configuration menu
    Copy the full SHA
    0c85ad8 View commit details
    Browse the repository at this point in the history
  18. Rollup merge of rust-lang#37565 - mglagla:peek_use_as_ref, r=alexcric…

    …hton
    
    Peekable::peek(): Use Option::as_ref()
    
    Replace the match expression in .peek() with Option::as_ref() since it's the same functionality.
    Jonathan Turner authored Nov 4, 2016
    Configuration menu
    Copy the full SHA
    8b9287d View commit details
    Browse the repository at this point in the history
  19. Rollup merge of rust-lang#37566 - brson:env, r=alexcrichton

    Set RUSTC_BOOTSTRAP to some value.
    
    Environment variables on windows can't be empty.
    Jonathan Turner authored Nov 4, 2016
    Configuration menu
    Copy the full SHA
    f6539dd View commit details
    Browse the repository at this point in the history
  20. Rollup merge of rust-lang#37577 - nnethercote:shrink-Expr-slightly, r…

    …=eddyb
    
    Shrink `hir::Expr` slightly
    
    r? @eddyb
    Jonathan Turner authored Nov 4, 2016
    Configuration menu
    Copy the full SHA
    323ce27 View commit details
    Browse the repository at this point in the history