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 6 pull requests #103685

Closed
wants to merge 26 commits into from
Closed

Commits on Oct 12, 2022

  1. Configuration menu
    Copy the full SHA
    328f817 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    36dbb07 View commit details
    Browse the repository at this point in the history

Commits on Oct 22, 2022

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

Commits on Oct 23, 2022

  1. Configuration menu
    Copy the full SHA
    8b984e5 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    e521a8d View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    86c65d2 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    daf3063 View commit details
    Browse the repository at this point in the history
  5. Apply suggestion

    Co-authored-by: Amanieu d'Antras <amanieu@gmail.com>
    nbdd0121 and Amanieu committed Oct 23, 2022
    Configuration menu
    Copy the full SHA
    979d1a2 View commit details
    Browse the repository at this point in the history
  6. Fix alloc size

    nbdd0121 committed Oct 23, 2022
    Configuration menu
    Copy the full SHA
    4e6d60c View commit details
    Browse the repository at this point in the history
  7. Fix windows compilation

    nbdd0121 committed Oct 23, 2022
    Configuration menu
    Copy the full SHA
    c9cca33 View commit details
    Browse the repository at this point in the history

Commits on Oct 25, 2022

  1. Allow impl Fn() -> impl Trait in return position

    This allows writing the following function signatures:
    ```rust
    fn f0() -> impl Fn() -> impl Trait;
    fn f3() -> &'static dyn Fn() -> impl Trait;
    ```
    
    These signatures were already allowed for common traits and associated
    types, there is no reason why `Fn*` traits should be special in this
    regard.
    WaffleLapkin committed Oct 25, 2022
    Configuration menu
    Copy the full SHA
    8b494f4 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    7a4ba2f View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    00f2277 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    cc752f5 View commit details
    Browse the repository at this point in the history
  5. --bless

    WaffleLapkin committed Oct 25, 2022
    Configuration menu
    Copy the full SHA
    d116859 View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    690e037 View commit details
    Browse the repository at this point in the history
  7. Configuration menu
    Copy the full SHA
    e93982a View commit details
    Browse the repository at this point in the history

Commits on Oct 27, 2022

  1. Ignore test on mingw32

    nbdd0121 committed Oct 27, 2022
    Configuration menu
    Copy the full SHA
    bfac2da View commit details
    Browse the repository at this point in the history

Commits on Oct 28, 2022

  1. add test for issue 98634

    Rageking8 committed Oct 28, 2022
    Configuration menu
    Copy the full SHA
    92b314b View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    b3f9277 View commit details
    Browse the repository at this point in the history
  3. Rollup merge of rust-lang#93582 - WaffleLapkin:rpitirpit, r=compiler-…

    …errors
    
    Allow `impl Fn() -> impl Trait` in return position
    
    _This was originally proposed as part of rust-lang#93082 which was [closed](rust-lang#93082 (comment)) due to allowing `impl Fn() -> impl Trait` in argument position._
    
    This allows writing the following function signatures:
    ```rust
    fn f0() -> impl Fn() -> impl Trait;
    fn f3() -> &'static dyn Fn() -> impl Trait;
    ```
    
    These signatures were already allowed for common traits and associated types, there is no reason why `Fn*` traits should be special in this regard.
    
    `impl Trait` in both `f0` and `f3` means "new existential type", just like with `-> impl Iterator<Item = impl Trait>` and such.
    
    Arrow in `impl Fn() ->` is right-associative and binds from right to left, it's tested by [this test](https://github.com/WaffleLapkin/rust/blob/a819fecb8dea438fc70488ddec30a61e52942672/src/test/ui/impl-trait/impl_fn_associativity.rs).
    
    There even is a test that `f0` compiles:
    https://github.com/rust-lang/rust/blob/2f004d2d401682e553af3984ebd9a3976885e752/src/test/ui/impl-trait/nested_impl_trait.rs#L25-L28
    
    But it was changed in [PR 48084 (lines)](https://github.com/rust-lang/rust/pull/48084/files#diff-ccecca938872d65ffe8cd1c3ef1956e309fac83bcda547d8b16b89257e53a437R37)  to test the opposite, probably unintentionally given [PR 48084 (lines)](https://github.com/rust-lang/rust/pull/48084/files#diff-5a02f1ed43debed1fd24f7aad72490064f795b9420f15d847bac822aa4621a1cR476-R477).
    
    r? `@nikomatsakis`
    
    ----
    
    This limitation is especially annoying with async code, since it forces one to write this:
    ```rust
    trait AsyncFn3<A, B, C>: Fn(A, B, C) -> <Self as AsyncFn3<A, B, C>>::Future {
        type Future: Future<Output = Self::Out>;
    
        type Out;
    }
    
    impl<A, B, C, Fut, F> AsyncFn3<A, B, C> for F
    where
        F: Fn(A, B, C) -> Fut,
        Fut: Future,
    {
        type Future = Fut;
    
        type Out = Fut::Output;
    }
    
    fn async_closure() -> impl AsyncFn3<i32, i32, i32, Out = u32> {
        |a, b, c| async move { (a + b + c) as u32 }
    }
    ```
    Instead of:
    ```rust
    fn async_closure() -> impl Fn(i32, i32, i32) -> impl Future<Output = u32> {
        |a, b, c| async move { (a + b + c) as u32 }
    }
    ```
    Dylan-DPC authored Oct 28, 2022
    Configuration menu
    Copy the full SHA
    38abbcf View commit details
    Browse the repository at this point in the history
  4. Rollup merge of rust-lang#100452 - ouz-a:issue-93242, r=jackh726

    Fake capture closures if typeck results are empty
    
    This ICE happens because `closure_min_captures` is empty, the reason it's empty is with the 2021 edition `enable_precise_capture` is set to true, which makes it so that we can't fake capture any information because that result of the `unwrap` is none hence the ICE.
    
    Other solution is editing [maybe_read_scrutinee](https://doc.rust-lang.org/nightly/nightly-rustc/src/rustc_typeck/expr_use_visitor.rs.html#453-463) to this since empty slice contains no sub patterns.
    
    Fixes rust-lang#93242
    
    ```rust
    PatKind::Slice(_, ref slice, _) => {
        if slice.is_none(){
        need_to_be_read = true;
        }
    }
    // instead of
    PatKind::Or(_)
    | PatKind::Box(_)
    | PatKind::Slice(..)
    | PatKind::Ref(..)
    | PatKind::Wild => {}
    ```
    Dylan-DPC authored Oct 28, 2022
    Configuration menu
    Copy the full SHA
    eb6cd05 View commit details
    Browse the repository at this point in the history
  5. Rollup merge of rust-lang#102721 - nbdd0121:panic, r=Amanieu

    Prevent foreign Rust exceptions from being caught
    
    Fix rust-lang#102715
    
    Use the address of a static variable (which is guaranteed to be unique per copy of std) to tell apart if a Rust exception comes from local or foreign Rust code, and abort for the latter.
    Dylan-DPC authored Oct 28, 2022
    Configuration menu
    Copy the full SHA
    28ece5a View commit details
    Browse the repository at this point in the history
  6. Rollup merge of rust-lang#102961 - reitermarkus:const-cstr-from-ptr, …

    …r=oli-obk
    
    Make `CStr::from_ptr` `const`.
    
    Should be included in rust-lang#101719.
    
    cc `@WaffleLapkin`
    Dylan-DPC authored Oct 28, 2022
    Configuration menu
    Copy the full SHA
    6db281a View commit details
    Browse the repository at this point in the history
  7. Rollup merge of rust-lang#103342 - Rageking8:add-test-for-issue-98634…

    …, r=compiler-errors
    
    Add test for issue 98634
    
    Fixes rust-lang#98634
    Dylan-DPC authored Oct 28, 2022
    Configuration menu
    Copy the full SHA
    ccc10a4 View commit details
    Browse the repository at this point in the history
  8. Rollup merge of rust-lang#103383 - compiler-errors:tait-scope, r=oli-obk

    Note scope of TAIT more accurately
    
    This maybe explains why the person was confused in rust-lang#101897, since we say "same module" but really should've said "same impl".
    
    r? `@oli-obk`
    Dylan-DPC authored Oct 28, 2022
    Configuration menu
    Copy the full SHA
    e7fb356 View commit details
    Browse the repository at this point in the history