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 16 pull requests #48348

Closed
wants to merge 59 commits into from
Closed

Commits on Feb 9, 2018

  1. Fix span bug.

    jseyfried committed Feb 9, 2018
    Configuration menu
    Copy the full SHA
    4d92fe2 View commit details
    Browse the repository at this point in the history

Commits on Feb 11, 2018

  1. rust: Import LLD for linking wasm objects

    This commit imports the LLD project from LLVM to serve as the default linker for
    the `wasm32-unknown-unknown` target. The `binaryen` submoule is consequently
    removed along with "binaryen linker" support in rustc.
    
    Moving to LLD brings with it a number of benefits for wasm code:
    
    * LLD is itself an actual linker, so there's no need to compile all wasm code
      with LTO any more. As a result builds should be *much* speedier as LTO is no
      longer forcibly enabled for all builds of the wasm target.
    * LLD is quickly becoming an "official solution" for linking wasm code together.
      This, I believe at least, is intended to be the main supported linker for
      native code and wasm moving forward. Picking up support early on should help
      ensure that we can help LLD identify bugs and otherwise prove that it works
      great for all our use cases!
    * Improvements to the wasm toolchain are currently primarily focused around LLVM
      and LLD (from what I can tell at least), so it's in general much better to be
      on this bandwagon for bugfixes and new features.
    * Historical "hacks" like `wasm-gc` will soon no longer be necessary, LLD
      will [natively implement][gc] `--gc-sections` (better than `wasm-gc`!) which
      means a postprocessor is no longer needed to show off Rust's "small wasm
      binary size".
    
    LLD is added in a pretty standard way to rustc right now. A new rustbuild target
    was defined for building LLD, and this is executed when a compiler's sysroot is
    being assembled. LLD is compiled against the LLVM that we've got in tree, which
    means we're currently on the `release_60` branch, but this may get upgraded in
    the near future!
    
    LLD is placed into rustc's sysroot in a `bin` directory. This is similar to
    where `gcc.exe` can be found on Windows. This directory is automatically added
    to `PATH` whenever rustc executes the linker, allowing us to define a `WasmLd`
    linker which implements the interface that `wasm-ld`, LLD's frontend, expects.
    
    Like Emscripten the LLD target is currently only enabled for Tier 1 platforms,
    notably OSX/Windows/Linux, and will need to be installed manually for compiling
    to wasm on other platforms. LLD is by default turned off in rustbuild, and
    requires a `config.toml` option to be enabled to turn it on.
    
    Finally the unstable `#![wasm_import_memory]` attribute was also removed as LLD
    has a native option for controlling this.
    
    [gc]: https://reviews.llvm.org/D42511
    alexcrichton committed Feb 11, 2018
    Configuration menu
    Copy the full SHA
    50642c8 View commit details
    Browse the repository at this point in the history
  2. rustc: Tweak default linker selection

    This commit refactors how the path to the linker that we're going to invoke is
    selected. Previously all targets listed *both* a `LinkerFlavor` and a `linker`
    (path) option, but this meant that whenever you changed one you had to change
    the other. The purpose of this commit is to avoid coupling these where possible.
    
    Target specifications now only unconditionally define the *flavor* of the linker
    that they're using by default. If not otherwise specified each flavor now
    implies a particular default linker to run. As a result, this means that if
    you'd like to test out `ld` for example you should be able to do:
    
        rustc -Z linker-flavor=ld foo.rs
    
    whereas previously you had to do
    
        rustc -Z linker-flavor=ld -C linker=ld foo.rs
    
    This will hopefully make it a bit easier to tinker around with variants that
    should otherwise be well known to work, for example with LLD, `ld` on OSX, etc.
    alexcrichton committed Feb 11, 2018
    Configuration menu
    Copy the full SHA
    ce52e0e View commit details
    Browse the repository at this point in the history
  3. Add test.

    jseyfried committed Feb 11, 2018
    Configuration menu
    Copy the full SHA
    a003cb7 View commit details
    Browse the repository at this point in the history

Commits on Feb 12, 2018

  1. Add Iterator::try_for_each

    The fallible version of for_each and the stateless version of try_fold.
    scottmcm committed Feb 12, 2018
    Configuration menu
    Copy the full SHA
    0bb818c View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    bd10ef7 View commit details
    Browse the repository at this point in the history
  3. detect wrong number of args when type-checking a closure

    Instead of creating inference variables for those argument types, use
    the trait error-reporting code to give a nicer error.
    nikomatsakis committed Feb 12, 2018
    Configuration menu
    Copy the full SHA
    cc05561 View commit details
    Browse the repository at this point in the history

Commits on Feb 13, 2018

  1. incr.comp.: Don't keep RefCells in on-disk-cache borrowed in order to…

    … allow for recursive invocations.
    michaelwoerister committed Feb 13, 2018
    Configuration menu
    Copy the full SHA
    335e25f View commit details
    Browse the repository at this point in the history

Commits on Feb 14, 2018

  1. Allow two-phase borrows of &mut self in ops

    We need two-phase borrows of ops to be in the initial NLL release since without
    them lots of existing code will break. Fixes rust-lang#48129
    sapphire-arches committed Feb 14, 2018
    Configuration menu
    Copy the full SHA
    3118cbe View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    75f72c0 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    70e1f4f View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    f1fbf79 View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    dbacf0c View commit details
    Browse the repository at this point in the history
  6. inform type annotations

    csmoe committed Feb 14, 2018
    Configuration menu
    Copy the full SHA
    20dcc72 View commit details
    Browse the repository at this point in the history
  7. Configuration menu
    Copy the full SHA
    d4b8475 View commit details
    Browse the repository at this point in the history
  8. Configuration menu
    Copy the full SHA
    9e9c55f View commit details
    Browse the repository at this point in the history

Commits on Feb 15, 2018

  1. Configuration menu
    Copy the full SHA
    7062955 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    f787bdd View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    c0517a3 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    d691c46 View commit details
    Browse the repository at this point in the history
  5. Convert compile-fail/lint-ctypes.rs to ui test

    Robin Kruppe committed Feb 15, 2018
    Configuration menu
    Copy the full SHA
    1f0e1a0 View commit details
    Browse the repository at this point in the history
  6. [improper_ctypes] Use a 'help:' line for possible fixes

    Robin Kruppe committed Feb 15, 2018
    Configuration menu
    Copy the full SHA
    7ac5e96 View commit details
    Browse the repository at this point in the history
  7. [improper_ctypes] Stop complaining about repr(usize) and repr(isize) …

    …enums
    
    This dates back to at least rust-lang#26583. At the time, usize and isize were considered ffi-unsafe to nudge people away from them, but this changed in the aforementioned PR, making it inconsistent to complain about it in enum discriminants. In fact, repr(usize) is probably the best way to interface with `enum Foo : size_t { ... }`.
    Robin Kruppe committed Feb 15, 2018
    Configuration menu
    Copy the full SHA
    ae92dfa View commit details
    Browse the repository at this point in the history
  8. [improper_ctypes] Overhaul primary label

    - Always name the non-FFI-safe
    - Explain *why* the type is not FFI-safe
    - Stop vaguely gesturing at structs/enums/unions if the non-FFI-safe types occured in a field.
    
    The last part is arguably a regression, but it's minor now that the non-FFI-safe type is actually named. Removing it avoids some code duplication.
    Robin Kruppe committed Feb 15, 2018
    Configuration menu
    Copy the full SHA
    9b5f47e View commit details
    Browse the repository at this point in the history
  9. [improper_ctypes] Suggest repr(transparent) for structs

    The suggestion is unconditional, so following it could lead to further errors. This is already the case for the repr(C) suggestion, which makes this acceptable, though not *good*. Checking up-front whether the suggestion can help would be great but applies more broadly (and would require some refactoring to avoid duplicating the checks).
    Robin Kruppe committed Feb 15, 2018
    Configuration menu
    Copy the full SHA
    22a1716 View commit details
    Browse the repository at this point in the history
  10. Configuration menu
    Copy the full SHA
    9d493c8 View commit details
    Browse the repository at this point in the history
  11. [improper_ctypes] Don't suggest raw pointers when encountering trait …

    …objects
    
    It's unhelpful since raw pointers to trait objects are also FFI-unsafe and casting to a thin raw pointer loses the vtable. There are working solutions that _involve_ raw pointers but they're too complex to explain in one line and have serious trade offs.
    Robin Kruppe committed Feb 15, 2018
    Configuration menu
    Copy the full SHA
    051ea5c View commit details
    Browse the repository at this point in the history

Commits on Feb 16, 2018

  1. save-analysis: power through bracket mis-counts

    Closes rust-lang#47981
    
    This is pretty unsatisfying since it is working around a span bug. However, I can't track down the span bug and it could be in the parser, proc macro expansion, the user macro, or Syn (or any other library that can manipulate spans). Given that user code can cause this error, I think we need to be more robust here.
    nrc committed Feb 16, 2018
    Configuration menu
    Copy the full SHA
    10fbdb8 View commit details
    Browse the repository at this point in the history

Commits on Feb 17, 2018

  1. fix stderr

    csmoe committed Feb 17, 2018
    Configuration menu
    Copy the full SHA
    0be2dc8 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    2cf683e View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    b3d6597 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    d8d4c58 View commit details
    Browse the repository at this point in the history

Commits on Feb 18, 2018

  1. Configuration menu
    Copy the full SHA
    472dcdb View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    4370a58 View commit details
    Browse the repository at this point in the history
  3. Fix span bug.

    jseyfried committed Feb 18, 2018
    Configuration menu
    Copy the full SHA
    ba8d6d1 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    4294528 View commit details
    Browse the repository at this point in the history
  5. Add test.

    jseyfried committed Feb 18, 2018
    Configuration menu
    Copy the full SHA
    876c42d View commit details
    Browse the repository at this point in the history
  6. Update tests.

    jseyfried committed Feb 18, 2018
    Configuration menu
    Copy the full SHA
    169643d View commit details
    Browse the repository at this point in the history

Commits on Feb 19, 2018

  1. bump pulldown

    Manishearth committed Feb 19, 2018
    Configuration menu
    Copy the full SHA
    6818551 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    f60aeec View commit details
    Browse the repository at this point in the history
  3. Generate shortcut links

    Manishearth committed Feb 19, 2018
    Configuration menu
    Copy the full SHA
    1d0ae9f View commit details
    Browse the repository at this point in the history
  4. Add test

    Manishearth committed Feb 19, 2018
    Configuration menu
    Copy the full SHA
    a04c124 View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    5fdc10c View commit details
    Browse the repository at this point in the history
  6. Rollup merge of rust-lang#48082 - jseyfried:improve_struct_field_hygi…

    …ene, r=jseyfried
    
    macros: improve struct constructor field hygiene, fix span bug
    
    Fixes rust-lang#47311.
    r? @nrc
    Manishearth authored Feb 19, 2018
    Configuration menu
    Copy the full SHA
    face16b View commit details
    Browse the repository at this point in the history
  7. Rollup merge of rust-lang#48083 - jseyfried:improve_tuple_struct_fiel…

    …d_access_hygiene, r=petrochenkov
    
    Improve tuple struct field access hygiene
    
    Fixes rust-lang#47312 by fixing a span bug.
    r? @nrc
    Manishearth authored Feb 19, 2018
    Configuration menu
    Copy the full SHA
    73b0514 View commit details
    Browse the repository at this point in the history
  8. Rollup merge of rust-lang#48084 - cramertj:impl-trait-errors, r=nikom…

    …atsakis
    
    Error on nested impl Trait and path projections from impl Trait
    
    cc rust-lang#34511
    
    r? @nikomatsakis
    Manishearth authored Feb 19, 2018
    Configuration menu
    Copy the full SHA
    250e021 View commit details
    Browse the repository at this point in the history
  9. Rollup merge of rust-lang#48106 - QuietMisdreavus:teleporting-crates,…

    … r=GuillaumeGomez
    
    rustdoc: move manual "extern crate" statements outside automatic "fn main"s in doctests
    
    Gated on rust-lang#48095 - I based the branch atop that so i could show off the change in one of its tests, the actual change in this PR is just the last commit
    
    There are a handful of unfortunate assumptions in the way rustdoc processes `extern crate` statements in doctests:
    
    1. In the absence of an `extern crate` statement in the test, if the test also uses the local crate name, it will automatically insert an `extern crate cratename;` statement into the test.
    2. If the doctest *does* include an `extern crate` statement, rustdoc will not automatically insert one, on the assumption that doing so would introduce a duplicate import.
    3. If a doctest does not have the substring `fn main` outside a comment, rustdoc will wrap the whole doctest in a generated `fn main` so it can be compiled.
    
    In short, whenever you write a doctest like this...
    
    ```rust
    //! extern crate my_crate;
    //! my_crate::some_cool_thing();
    ```
    
    ...rustdoc will turn it into (something like) this:
    
    ```rust
    fn main() {
    extern crate my_crate;
    my_crate::some_cool_thing();
    }
    ```
    
    This creates issues when compiled, because now `my_crate` isn't even properly in scope! This forces people who want to have multiple crates in their doctests (or an explicit `extern crate` statement) to also manually include their own `fn main`, so rustdoc doesn't put their imports in the wrong place.
    
    This PR just taps into another processing step rustdoc does to doctests: Whenever you add an `#![inner_attribute]` to the beginning of a doctest, rustdoc will actually splice those out and put it before the generated `fn main`. Now, we can just do the same with `extern crate`s at the beginning, too, and get a much nicer experience.
    
    Now, the above example will be converted into this:
    
    ```rust
    extern crate my_crate;
    fn main() {
    my_crate::some_cool_thing();
    }
    ```
    Manishearth authored Feb 19, 2018
    Configuration menu
    Copy the full SHA
    4ec81b3 View commit details
    Browse the repository at this point in the history
  10. Rollup merge of rust-lang#48123 - nikomatsakis:issue-47244-expected-n…

    …um-args, r=estebank
    
    detect wrong number of args when type-checking a closure
    
    Instead of creating inference variables for those argument types, use
    the trait error-reporting code to give a nicer error. This also
    improves some other spans for existing tests.
    
    Fixes rust-lang#47244
    
    r? @estebank
    Manishearth authored Feb 19, 2018
    Configuration menu
    Copy the full SHA
    e91f1c0 View commit details
    Browse the repository at this point in the history
  11. Rollup merge of rust-lang#48125 - alexcrichton:lld, r=Mark-Simulacrum

    rust: Import LLD for linking wasm objects
    
    This commit imports the LLD project from LLVM to serve as the default linker for
    the `wasm32-unknown-unknown` target. The `binaryen` submoule is consequently
    removed along with "binaryen linker" support in rustc.
    
    Moving to LLD brings with it a number of benefits for wasm code:
    
    * LLD is itself an actual linker, so there's no need to compile all wasm code
      with LTO any more. As a result builds should be *much* speedier as LTO is no
      longer forcibly enabled for all builds of the wasm target.
    * LLD is quickly becoming an "official solution" for linking wasm code together.
      This, I believe at least, is intended to be the main supported linker for
      native code and wasm moving forward. Picking up support early on should help
      ensure that we can help LLD identify bugs and otherwise prove that it works
      great for all our use cases!
    * Improvements to the wasm toolchain are currently primarily focused around LLVM
      and LLD (from what I can tell at least), so it's in general much better to be
      on this bandwagon for bugfixes and new features.
    * Historical "hacks" like `wasm-gc` will soon no longer be necessary, LLD
      will [natively implement][gc] `--gc-sections` (better than `wasm-gc`!) which
      means a postprocessor is no longer needed to show off Rust's "small wasm
      binary size".
    
    LLD is added in a pretty standard way to rustc right now. A new rustbuild target
    was defined for building LLD, and this is executed when a compiler's sysroot is
    being assembled. LLD is compiled against the LLVM that we've got in tree, which
    means we're currently on the `release_60` branch, but this may get upgraded in
    the near future!
    
    LLD is placed into rustc's sysroot in a `bin` directory. This is similar to
    where `gcc.exe` can be found on Windows. This directory is automatically added
    to `PATH` whenever rustc executes the linker, allowing us to define a `WasmLd`
    linker which implements the interface that `wasm-ld`, LLD's frontend, expects.
    
    Like Emscripten the LLD target is currently only enabled for Tier 1 platforms,
    notably OSX/Windows/Linux, and will need to be installed manually for compiling
    to wasm on other platforms. LLD is by default turned off in rustbuild, and
    requires a `config.toml` option to be enabled to turn it on.
    
    Finally the unstable `#![wasm_import_memory]` attribute was also removed as LLD
    has a native option for controlling this.
    
    [gc]: https://reviews.llvm.org/D42511
    Manishearth authored Feb 19, 2018
    Configuration menu
    Copy the full SHA
    0bac52a View commit details
    Browse the repository at this point in the history
  12. Rollup merge of rust-lang#48157 - scottmcm:try-for-each, r=dtolnay

    Add Iterator::try_for_each
    
    The fallible version of `for_each` aka the stateless version of `try_fold`.  Inspired by @cuviper's comment in rust-lang#45379 (comment) as a more direct and obvious solution than `.map(f).collect::<Result<(), _>>()`.
    
    Like `for_each`, no need for an `r` version thanks to overrides in `Rev`.
    
    `iterator_try_fold` tracking issue: rust-lang#45594
    Manishearth authored Feb 19, 2018
    Configuration menu
    Copy the full SHA
    ed532f9 View commit details
    Browse the repository at this point in the history
  13. Rollup merge of rust-lang#48185 - michaelwoerister:recursive-cache-de…

    …coding, r=nikomatsakis
    
    incr.comp.: Don't keep RefCells in on-disk-cache borrowed in order to allow for recursive invocations.
    
    Fixes rust-lang#47972.
    
    r? @nikomatsakis
    Manishearth authored Feb 19, 2018
    Configuration menu
    Copy the full SHA
    1a4b5fb View commit details
    Browse the repository at this point in the history
  14. Rollup merge of rust-lang#48197 - bobtwinkles:two_phase_borrow_on_ops…

    …, r=nikomatsakis
    
    Allow two-phase borrows of &mut self in ops
    
    We need two-phase borrows of ops to be in the initial NLL release since without them lots of existing code will break. Fixes rust-lang#48129.
    CC @pnkfelix  and @nikomatsakis
    
    r? @pnkfelix
    Manishearth authored Feb 19, 2018
    Configuration menu
    Copy the full SHA
    ac82683 View commit details
    Browse the repository at this point in the history
  15. Rollup merge of rust-lang#48198 - csmoe:inform_type_annotations, r=es…

    …tebank
    
    inform user where to give a type annotation
    
    should resolve rust-lang#47777
    previous pull request rust-lang#47982 was closed because of a mistaken rebase.
    r? @estebank
    Manishearth authored Feb 19, 2018
    Configuration menu
    Copy the full SHA
    68a69fe View commit details
    Browse the repository at this point in the history
  16. Rollup merge of rust-lang#48206 - michaelwoerister:colors-array, r=ni…

    …komatsakis
    
    incr.comp.: Store DepNode colors in a dense array instead of a hashmap.
    
    Implements half of rust-lang#47293.
    
    r? @nikomatsakis
    Manishearth authored Feb 19, 2018
    Configuration menu
    Copy the full SHA
    c9103c3 View commit details
    Browse the repository at this point in the history
  17. Rollup merge of rust-lang#48208 - michaelwoerister:track-features, r=…

    …petrochenkov
    
    Turn feature-gate table into a query so it is covered by dependency tracking.
    
    Turn access to feature gates into a query so we handle them correctly during incremental compilation.
    
    Features are still available via `Session` through `features_untracked()`. I wish we had a better way of hiding untracked information. It would be great if we could remove the `sess` field from `TyCtxt`.
    
    Fixes rust-lang#47003.
    Manishearth authored Feb 19, 2018
    Configuration menu
    Copy the full SHA
    23cf624 View commit details
    Browse the repository at this point in the history
  18. Rollup merge of rust-lang#48221 - rkruppe:improve-ctypes-lint, r=este…

    …bank
    
    Overhaul improper_ctypes output
    
    This snowballed into a rather big set of improvements to the diagnostics of the improper_ctypes lint. See commits for details, including effects of each change on the `compile-fail/improper-ctypes.rs` test (now a UI test), which is pretty gnarly and hopefully not representative of real code, but covers a lot of different error cases.
    
    Fixes rust-lang#42050
    Manishearth authored Feb 19, 2018
    Configuration menu
    Copy the full SHA
    bce6664 View commit details
    Browse the repository at this point in the history
  19. Rollup merge of rust-lang#48258 - nrc:save-proc-nested, r=eddyb

    save-analysis: power through bracket mis-counts
    
    Closes rust-lang#47981
    
    This is pretty unsatisfying since it is working around a span bug. However, I can't track down the span bug and it could be in the parser, proc macro expansion, the user macro, or Syn (or any other library that can manipulate spans). Given that user code can cause this error, I think we need to be more robust here.
    
    r? @eddyb
    Manishearth authored Feb 19, 2018
    Configuration menu
    Copy the full SHA
    64877dc View commit details
    Browse the repository at this point in the history
  20. Rollup merge of rust-lang#48314 - frewsxcv:frewsxcv-broken-link, r=Gu…

    …illaumeGomez
    
    Fix broken documentation link.
    
    None
    Manishearth authored Feb 19, 2018
    Configuration menu
    Copy the full SHA
    b7b3e3a View commit details
    Browse the repository at this point in the history
  21. Rollup merge of rust-lang#48335 - Manishearth:shortcut-links, r=Quiet…

    …Misdreavus
    
    Implement implied shortcut links for intra-rustdoc-links
    
    cc rust-lang#43466
    
    Needs pulldown-cmark/pulldown-cmark#126
    
    r? @QuietMisdreavus
    Manishearth authored Feb 19, 2018
    Configuration menu
    Copy the full SHA
    c787251 View commit details
    Browse the repository at this point in the history