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 7 pull requests #73062

Closed
wants to merge 16 commits into from
Closed

Commits on May 2, 2020

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

Commits on May 30, 2020

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

Commits on Jun 1, 2020

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

Commits on Jun 4, 2020

  1. Add -Z span-debug to allow for easier debugging of proc macros

    Currently, the `Debug` impl for `proc_macro::Span` just prints out
    the byte range. This can make debugging proc macros (either as a crate
    author or as a compiler developer) very frustrating, since neither the
    actual filename nor the `SyntaxContext` is displayed.
    
    This commit adds a perma-unstable flag `-Z span-debug`. When enabled,
    the `Debug` impl for `proc_macro::Span` simply forwards directly to
    `rustc_span::Span`. Once rust-lang#72618 is merged, this will start displaying
    actual line numbers.
    
    While `Debug` impls are not subject to Rust's normal stability
    guarnatees, we probably shouldn't expose any additional information on
    stable until `#![feature(proc_macro_span)]` is stabilized. Otherwise,
    we would be providing a 'backdoor' way to access information that's
    supposed be behind unstable APIs.
    Aaron1011 committed Jun 4, 2020
    Configuration menu
    Copy the full SHA
    b541d3d View commit details
    Browse the repository at this point in the history

Commits on Jun 5, 2020

  1. Configuration menu
    Copy the full SHA
    2764e54 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    84e4777 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    4d6a307 View commit details
    Browse the repository at this point in the history

Commits on Jun 6, 2020

  1. remove outdated comment

    lcnr committed Jun 6, 2020
    Configuration menu
    Copy the full SHA
    32c488f View commit details
    Browse the repository at this point in the history
  2. Rollup merge of rust-lang#71796 - RalfJung:from-secs, r=nikomatsakis

    de-promote Duration::from_secs
    
    In rust-lang#67531, we removed the `rustc_promotable` attribute from a bunch of `Duration` methods, but not from `Duration::from_secs`. This makes the current list of promotable functions the following (courtesy of @ecstatic-morse):
    
    * `INT::min_value`, `INT::max_value`
    * `std::mem::size_of`, `std::mem::align_of`
    * `RangeInclusive::new` (backing `x..=y`)
    * `std::ptr::null`, `std::ptr::null_mut`
    * `RawWaker::new`, `RawWakerVTable::new` ???
    * `Duration::from_secs`
    
    I feel like the last one stands out a bit here -- the rest are all very core language primitives, and `RawWaker` has a strong motivation for getting a `'static` vtable. But a `&'static Duration`? That seems unlikely. So I propose we no longer promote calls to `Duration::from_secs`, which is what this PR does.
    
    rust-lang#67531 saw zero regressions and I am not aware of anyone complaining that this broke their (non-cratered) code, so I consider it likely the same will be true here, but of course we'd do a crater run.
    
    See [this document](https://github.com/rust-lang/const-eval/blob/master/promotion.md) for some more background on promotion and rust-lang/const-eval#19 for some of the concerns around promoting function calls.
    RalfJung authored Jun 6, 2020
    Configuration menu
    Copy the full SHA
    edb5cdc View commit details
    Browse the repository at this point in the history
  3. Rollup merge of rust-lang#72508 - ecstatic-morse:poly-self-ty, r=niko…

    …matsakis
    
    Make `PolyTraitRef::self_ty` return `Binder<Ty>`
    
    This came up during review of rust-lang#71618. The current implementation is the same as a call to `skip_binder` but harder to audit. Make it preserve binding levels and add a call to `skip_binder` at all use sites so they can be audited as part of rust-lang#72507.
    RalfJung authored Jun 6, 2020
    Configuration menu
    Copy the full SHA
    00eda74 View commit details
    Browse the repository at this point in the history
  4. Rollup merge of rust-lang#72764 - jonas-schievink:mind-the-tyerr, r=e…

    …stebank
    
    Be more careful around ty::Error in generators
    
    cc rust-lang#72685
    
    (doesn't close it because it's missing a reproduction to use as a test case)
    
    r? @estebank
    RalfJung authored Jun 6, 2020
    Configuration menu
    Copy the full SHA
    607526e View commit details
    Browse the repository at this point in the history
  5. Rollup merge of rust-lang#72799 - Aaron1011:feature/span-debug, r=pet…

    …rochenkov
    
    Add `-Z span-debug` to allow for easier debugging of proc macros
    
    Currently, the `Debug` impl for `proc_macro::Span` just prints out
    the byte range. This can make debugging proc macros (either as a crate
    author or as a compiler developer) very frustrating, since neither the
    actual filename nor the `SyntaxContext` is displayed.
    
    This commit adds a perma-unstable flag `-Z span-debug`. When enabled,
    the `Debug` impl for `proc_macro::Span` simply forwards directly to
    `rustc_span::Span`. Once rust-lang#72618 is merged, this will start displaying
    actual line numbers.
    
    While `Debug` impls are not subject to Rust's normal stability
    guarnatees, we probably shouldn't expose any additional information on
    stable until `#![feature(proc_macro_span)]` is stabilized. Otherwise,
    we would be providing a 'backdoor' way to access information that's
    supposed be behind unstable APIs.
    RalfJung authored Jun 6, 2020
    Configuration menu
    Copy the full SHA
    28adf2a View commit details
    Browse the repository at this point in the history
  6. Rollup merge of rust-lang#73007 - yoshuawuyts:socketaddr-from-string-…

    …u16, r=sfackler
    
    impl ToSocketAddrs for (String, u16)
    
    This adds a convenience impl of `ToSocketAddrs for (String, u16)`. When authoring HTTP services it's common to take command line options for `host` and `port` and parse them into `String` and `u16` respectively. Consider the following program:
    ```rust
    #[derive(Debug, StructOpt)]
    struct Config {
        host: String,
        port: u16,
    }
    
    async fn main() -> io::Result<()> {
        let config = Config::from_args();
        let stream = TcpStream::connect((&*config.host, config.port))?; // &* is not ideal
        // ...
    }
    ```
    
    Networking is a pretty common starting point for people new to Rust, and seeing `&*` in basic examples can be confusing. Even as someone that has experience with networking in Rust I tend to forget that `String` can't be passed directly there. Instead with this patch we can omit the `&*` conversion and pass `host` directly:
    ```rust
    #[derive(Debug, StructOpt)]
    struct Config {
        host: String,
        port: u16,
    }
    
    async fn main() -> io::Result<()> {
        let config = Config::from_args();
        let stream = TcpStream::connect((config.host, config.port))?; // no more conversions!
        // ...
    }
    ```
    
    I think should be an easy and small ergonomics improvement for networking. Thanks!
    RalfJung authored Jun 6, 2020
    Configuration menu
    Copy the full SHA
    ce6e596 View commit details
    Browse the repository at this point in the history
  7. Rollup merge of rust-lang#73046 - marmeladema:save-analysis-fix-path,…

    … r=Xanewok
    
    save_analysis: fix some ICEs
    
    Fixes rust-lang#73020
    Fixes rust-lang#73022
    Fixes rust-lang#73041
    RalfJung authored Jun 6, 2020
    Configuration menu
    Copy the full SHA
    9f4fce1 View commit details
    Browse the repository at this point in the history
  8. Configuration menu
    Copy the full SHA
    d92ab11 View commit details
    Browse the repository at this point in the history