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 9 pull requests #45822

Merged
merged 26 commits into from
Nov 7, 2017
Merged

Rollup of 9 pull requests #45822

merged 26 commits into from
Nov 7, 2017

Commits on Oct 31, 2017

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

Commits on Nov 1, 2017

  1. RwLock guards are Sync if T is

    Currently, the compiler requires `T` to also be `Send`.  There is no reason for
    that.  `&Rw{Read,Write}LockGuard` only provides a shared referenced to `T`, sending
    that across threads is safe if `T` is `Sync`.
    RalfJung committed Nov 1, 2017
    Configuration menu
    Copy the full SHA
    71534c4 View commit details
    Browse the repository at this point in the history

Commits on Nov 2, 2017

  1. Configuration menu
    Copy the full SHA
    5687000 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    283b4a1 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    a12f511 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    b86bba5 View commit details
    Browse the repository at this point in the history

Commits on Nov 4, 2017

  1. rustbuild: don't try to install rls if ToolState is not Testing

    The Dist Step is not ran in that case so we would end up trying to
    install something that we didn't dist.
    
    Signed-off-by: Marc-Antoine Perennou <[email protected]>
    Keruspe committed Nov 4, 2017
    Configuration menu
    Copy the full SHA
    784528b View commit details
    Browse the repository at this point in the history

Commits on Nov 5, 2017

  1. Update reference link in doc's 404

    It's currently linking to a page that says it's on the page I'm changing the link too.
    Havvy authored Nov 5, 2017
    Configuration menu
    Copy the full SHA
    6363b06 View commit details
    Browse the repository at this point in the history
  2. rustdoc: add #[allow(unused)] to every doctest

    also modify the order crate attributes are applied, to have a better
    order of how things can override lints, either per-crate or per-test
    QuietMisdreavus committed Nov 5, 2017
    Configuration menu
    Copy the full SHA
    5abc524 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    ce2768a View commit details
    Browse the repository at this point in the history
  4. Pretty print parens around casts on the LHS of '<'

    When pretty printing a cast expression occuring on the LHS of a '<'
    or '<<' expression, we should add parens around the cast. Otherwise,
    the '<'/'<<' gets interpreted as the beginning of the generics for
    the type on the RHS of the cast.
    harpocrates committed Nov 5, 2017
    Configuration menu
    Copy the full SHA
    45a0aa4 View commit details
    Browse the repository at this point in the history
  5. Handle anon lifetime arg being returned with named lifetime return type

    When there's a lifetime mismatch between an argument with an anonymous
    lifetime being returned in a method with a return type that has a named
    lifetime, show specialized lifetime error pointing at argument with a
    hint to give it an explicit lifetime matching the return type.
    
    ```
    error[E0621]: explicit lifetime required in the type of `other`
      --> file2.rs:21:21
       |
    17 |     fn bar(&self, other: Foo) -> Foo<'a> {
       |                   ----- consider changing the type of `other` to `Foo<'a>`
    ...
    21 |                     other
       |                     ^^^^^ lifetime `'a` required
    ```
    
    Follow up to rust-lang#44124 and rust-lang#42669.
    estebank committed Nov 5, 2017
    Configuration menu
    Copy the full SHA
    de959af View commit details
    Browse the repository at this point in the history
  6. Added tests

    harpocrates committed Nov 5, 2017
    Configuration menu
    Copy the full SHA
    005d14d View commit details
    Browse the repository at this point in the history

Commits on Nov 6, 2017

  1. Fix comments

    harpocrates committed Nov 6, 2017
    Configuration menu
    Copy the full SHA
    3761c0d View commit details
    Browse the repository at this point in the history

Commits on Nov 7, 2017

  1. Display all emission types in error msg if user inputs invalid option.

    before:
    
    ```
    > rustc --emit foo
    error: unknown emission type: `foo`
    ```
    
    after:
    
    ```
    > rustc --emit foo
    error: unknown emission type: `foo` - expected one of: `llvm-bc`, `asm`, `llvm-ir`, `mir`, `obj`, `metadata`, `link`, `dep-info`
    ```
    frewsxcv committed Nov 7, 2017
    Configuration menu
    Copy the full SHA
    c3ea358 View commit details
    Browse the repository at this point in the history
  2. review comments

    estebank committed Nov 7, 2017
    Configuration menu
    Copy the full SHA
    805333b View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    aa38a1e View commit details
    Browse the repository at this point in the history
  4. Rollup merge of rust-lang#45470 - GuillaumeGomez:unix-metadata-ext, r…

    …=QuietMisdreavus
    
    add missing docs for MetadataExt
    
    r? @rust-lang/docs
    kennytm committed Nov 7, 2017
    Configuration menu
    Copy the full SHA
    8074361 View commit details
    Browse the repository at this point in the history
  5. Rollup merge of rust-lang#45588 - Keruspe:master, r=alexcrichton

    rustbuild: don't try to install rls if ToolState is not Testing
    
    We already do that for the Dist Step so we would end up trying to install something that we didn't dist.
    kennytm committed Nov 7, 2017
    Configuration menu
    Copy the full SHA
    843dc4b View commit details
    Browse the repository at this point in the history
  6. Rollup merge of rust-lang#45682 - RalfJung:rwlock-guards, r=alexcrichton

    RwLock guards are Sync if T is
    
    Currently, the compiler requires `T` to also be `Send`.  There is no reason for
    that.  `&Rw{Read,Write}LockGuard` only provides a shared referenced to `T`, sending
    that across threads is safe if `T` is `Sync`.
    
    Cc @oconnor663
    kennytm committed Nov 7, 2017
    Configuration menu
    Copy the full SHA
    eae3671 View commit details
    Browse the repository at this point in the history
  7. Rollup merge of rust-lang#45714 - sdroege:thread-panic-docs, r=dtolnay

    Update the std::thread docs and clarify that panics can nowadays be caught
    kennytm committed Nov 7, 2017
    Configuration menu
    Copy the full SHA
    264bfc4 View commit details
    Browse the repository at this point in the history
  8. Rollup merge of rust-lang#45751 - estebank:issue-44684, r=nikomatsakis

    Handle anon lifetime arg being returned with named lifetime return type
    
    When there's a lifetime mismatch between an argument with an anonymous
    lifetime being returned in a method with a return type that has a named
    lifetime, show specialized lifetime error pointing at argument with a
    hint to give it an explicit lifetime matching the return type.
    
    ```
    error[E0621]: explicit lifetime required in the type of `other`
      --> file2.rs:21:21
       |
    17 |     fn bar(&self, other: Foo) -> Foo<'a> {
       |                   ----- consider changing the type of `other` to `Foo<'a>`
    ...
    21 |                     other
       |                     ^^^^^ lifetime `'a` required
    ```
    
    Follow up to rust-lang#44124 and rust-lang#42669. Fix rust-lang#44684.
    kennytm committed Nov 7, 2017
    Configuration menu
    Copy the full SHA
    d8238e4 View commit details
    Browse the repository at this point in the history
  9. Rollup merge of rust-lang#45764 - QuietMisdreavus:rustdoc-doctest-lin…

    …ts, r=GuillaumeGomez
    
    rustdoc: add #[allow(unused)] to every doctest
    
    More information in rust-lang#45750 - this is behavior that was documented but not actually implemented.
    
    I also reordered how outer attributes are applied to doctests. Previously, attributes from `#![doc(test(attr(...)))]` would be applied *after* attributes from within the test itself, meaning if a doctest tried to override lints that would be set crate-wide, it wouldn't work at all. This gives a better scope of how lints can be applied.
    
    Closes rust-lang#45750
    kennytm committed Nov 7, 2017
    Configuration menu
    Copy the full SHA
    4b2a5da View commit details
    Browse the repository at this point in the history
  10. Rollup merge of rust-lang#45778 - Havvy:patch-1, r=steveklabnik

    Update reference link in doc's 404
    
    It's currently linking to a page that says it's on the page I'm changing the link too.
    kennytm committed Nov 7, 2017
    Configuration menu
    Copy the full SHA
    6c8a2f6 View commit details
    Browse the repository at this point in the history
  11. Rollup merge of rust-lang#45782 - frewsxcv:frewsxcv-shorthands-helper…

    …s, r=manishearth
    
    Display all emission types in error msg if user inputs invalid option.
    
    before:
    
    ```
    > rustc --emit foo
    error: unknown emission type: `foo`
    ```
    
    after:
    
    ```
    > rustc --emit foo
    error: unknown emission type: `foo` - expected one of: `llvm-bc`, `asm`, `llvm-ir`, `mir`, `obj`, `metadata`, `link`, `dep-info`
    ```
    kennytm committed Nov 7, 2017
    Configuration menu
    Copy the full SHA
    1683b83 View commit details
    Browse the repository at this point in the history
  12. Rollup merge of rust-lang#45784 - harpocrates:fix/print-parens-cast-l…

    …t, r=kennytm
    
    Pretty print parens around casts on the LHS of `<`/`<<`
    
    When pretty printing a cast expression occuring on the LHS of a `<` or `<<` expression, we should add parens around the cast. Otherwise, the `<`/`<<` gets interpreted as the beginning of the generics for the type on the RHS of the cast.
    
    Consider:
    
        $ cat parens_cast.rs
        macro_rules! negative {
            ($e:expr) => { $e < 0 }
        }
    
        fn main() {
            negative!(1 as i32);
        }
    
    Before this PR, the output of the following is not valid Rust:
    
        $ rustc -Z unstable-options --pretty=expanded parens_cast.rs
        #![feature(prelude_import)]
        #![no_std]
        #[prelude_import]
        use std::prelude::v1::*;
        #[macro_use]
        extern crate std as std;
        macro_rules! negative(( $ e : expr ) => { $ e < 0 });
    
        fn main() { 1 as i32 < 0; }
    
    After this PR, the output of the following is valid Rust:
    
        $ rustc -Z unstable-options --pretty=expanded parens_cast.rs
        #![feature(prelude_import)]
        #![no_std]
        #[prelude_import]
        use std::prelude::v1::*;
        #[macro_use]
        extern crate std as std;
        macro_rules! negative(( $ e : expr ) => { $ e < 0 });
    
        fn main() { (1 as i32) < 0; }
    
    I've gone through several README/wiki style documents but I'm still not sure where to test this though. I'm not even sure if this sort of thing is tested...
    kennytm committed Nov 7, 2017
    Configuration menu
    Copy the full SHA
    0d53ecd View commit details
    Browse the repository at this point in the history