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 10 pull requests #127244

Merged
merged 25 commits into from
Jul 2, 2024
Merged

Rollup of 10 pull requests #127244

merged 25 commits into from
Jul 2, 2024

Commits on Jun 24, 2024

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

Commits on Jun 29, 2024

  1. Make all tests in async dir build-pass, adjust implements-fnmut test …

    …to begin ICEing during codegen
    compiler-errors committed Jun 29, 2024
    Configuration menu
    Copy the full SHA
    294436d View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    90143b0 View commit details
    Browse the repository at this point in the history

Commits on Jun 30, 2024

  1. Configuration menu
    Copy the full SHA
    53db641 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    3d6cc60 View commit details
    Browse the repository at this point in the history

Commits on Jul 1, 2024

  1. Configuration menu
    Copy the full SHA
    8cc1ed8 View commit details
    Browse the repository at this point in the history
  2. Update books

    rustbot committed Jul 1, 2024
    Configuration menu
    Copy the full SHA
    8d1065c View commit details
    Browse the repository at this point in the history
  3. Make FloatTy checks exhaustive in pretty print

    This should prevent the default fallback if we add more float types in the
    future.
    tgross35 committed Jul 1, 2024
    Configuration menu
    Copy the full SHA
    bb4c427 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    09e0abb View commit details
    Browse the repository at this point in the history
  5. Use the aligned size for alloca at args when the pass mode is cast.

    The `load` and `store` instructions in LLVM access the aligned size.
    DianQK committed Jul 1, 2024
    Configuration menu
    Copy the full SHA
    c453dcd View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    2ef8280 View commit details
    Browse the repository at this point in the history

Commits on Jul 2, 2024

  1. Configuration menu
    Copy the full SHA
    0698223 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    ada9fda View commit details
    Browse the repository at this point in the history
  3. Use cfg!(windows)

    ChrisDenton committed Jul 2, 2024
    Configuration menu
    Copy the full SHA
    b998cff View commit details
    Browse the repository at this point in the history
  4. Add test

    BoxyUwU committed Jul 2, 2024
    Configuration menu
    Copy the full SHA
    1df876f View commit details
    Browse the repository at this point in the history
  5. Rollup merge of rust-lang#126883 - dtolnay:breakvalue, r=fmease

    Parenthesize break values containing leading label
    
    The AST pretty printer previously produced invalid syntax in the case of `break` expressions with a value that begins with a loop or block label.
    
    ```rust
    macro_rules! expr {
        ($e:expr) => {
            $e
        };
    }
    
    fn main() {
        loop {
            break expr!('a: loop { break 'a 1; } + 1);
        };
    }
    ```
    
    `rustc -Zunpretty=expanded main.rs `:
    
    ```console
    #![feature(prelude_import)]
    #![no_std]
    #[prelude_import]
    use ::std::prelude::rust_2015::*;
    #[macro_use]
    extern crate std;
    macro_rules! expr { ($e:expr) => { $e }; }
    
    fn main() { loop { break 'a: loop { break 'a 1; } + 1; }; }
    ```
    
    The expanded code is not valid Rust syntax. Printing invalid syntax is bad because it blocks `cargo expand` from being able to format the output as Rust syntax using rustfmt.
    
    ```console
    error: parentheses are required around this expression to avoid confusion with a labeled break expression
     --> <anon>:9:26
      |
    9 | fn main() { loop { break 'a: loop { break 'a 1; } + 1; }; }
      |                          ^^^^^^^^^^^^^^^^^^^^^^^^
      |
    help: wrap the expression in parentheses
      |
    9 | fn main() { loop { break ('a: loop { break 'a 1; }) + 1; }; }
      |                          +                        +
    ```
    
    This PR updates the AST pretty-printer to insert parentheses around the value of a `break` expression as required to avoid this edge case.
    matthiaskrgr authored Jul 2, 2024
    Configuration menu
    Copy the full SHA
    f8f67b2 View commit details
    Browse the repository at this point in the history
  6. Rollup merge of rust-lang#127136 - compiler-errors:coroutine-closure-…

    …env-shim, r=oli-obk
    
    Fix `FnMut::call_mut`/`Fn::call` shim for async closures that capture references
    
    I adjusted async closures to be able to implement `Fn` and `FnMut` *even if* they capture references, as long as those references did not need to borrow data from the closure captures themselves. See rust-lang#125259.
    
    However, when I did this, I didn't actually relax an assertion in the `build_construct_coroutine_by_move_shim` shim code, which builds the `Fn`/`FnMut`/`FnOnce` implementations for async closures. Therefore, if we actually tried to *call* `FnMut`/`Fn` on async closures, it would ICE.
    
    This PR adjusts this assertion to ensure that we only capture immutable references in closures if they implement `Fn`/`FnMut`. It also adds a bunch of tests and makes more of the async-closure tests into `build-pass` since we often care about these tests actually generating the right closure shims and stuff. I think it might be excessive to *always* use build-pass here, but 🤷 it's not that big of a deal.
    
    Fixes rust-lang#127019
    Fixes rust-lang#127012
    
    r? oli-obk
    matthiaskrgr authored Jul 2, 2024
    Configuration menu
    Copy the full SHA
    3cf567e View commit details
    Browse the repository at this point in the history
  7. Rollup merge of rust-lang#127146 - compiler-errors:fast-reject, r=lcnr

    Uplift fast rejection to new solver
    
    Self explanatory.
    
    r? lcnr
    matthiaskrgr authored Jul 2, 2024
    Configuration menu
    Copy the full SHA
    36da46a View commit details
    Browse the repository at this point in the history
  8. Rollup merge of rust-lang#127152 - ChrisDenton:rename, r=onur-ozkan

    Bootstrap: Try renaming the file if removing fails
    
    Second attempt at working around rust-lang#127126
    
    If we can't remove the file, then try renaming it. This will leave the destination path free to use.
    
    try-job: x86_64-msvc-ext
    matthiaskrgr authored Jul 2, 2024
    Configuration menu
    Copy the full SHA
    836ce13 View commit details
    Browse the repository at this point in the history
  9. Rollup merge of rust-lang#127168 - DianQK:cast-size, r=workingjubilee

    Use the aligned size for alloca at args/ret when the pass mode is cast
    
    Fixes rust-lang#75839. Fixes rust-lang#121028.
    
    The `load` and `store` instructions in LLVM access the aligned size. For example, `load { i64, i32 }` accesses 16 bytes on x86_64: https://alive2.llvm.org/ce/z/n8CHAp.
    
    BTW, this example is expected to be optimized to immediate UB by Alive2: https://rust.godbolt.org/z/b7xK7hv1c and https://alive2.llvm.org/ce/z/vZDtZH.
    
    r? compiler
    matthiaskrgr authored Jul 2, 2024
    Configuration menu
    Copy the full SHA
    33b0238 View commit details
    Browse the repository at this point in the history
  10. Rollup merge of rust-lang#127203 - chenyukang:yukang-fix-120074-impor…

    …t, r=Nadrieril
    
    Fix import suggestion error when path segment failed not from starting
    
    Fixes rust-lang#120074
    matthiaskrgr authored Jul 2, 2024
    Configuration menu
    Copy the full SHA
    4d2a049 View commit details
    Browse the repository at this point in the history
  11. Rollup merge of rust-lang#127212 - rustbot:docs-update, r=ehuss

    Update books
    
    ## rust-lang/book
    
    2 commits in 45c1a6d69edfd1fc91fb7504cb73958dbd09441e..f1e49bf7a8ea6c31ce016a52b8a4f6e1ffcfbc64
    2024-06-25 21:12:15 UTC to 2024-06-20 16:10:32 UTC
    
    - Update ch10-00-generics.md (rust-lang/book#3963)
    - infra: ignore Nova configuration directory (rust-lang/book#3962)
    
    ## rust-lang/edition-guide
    
    3 commits in cb58c430b4e8054c2cb81d2d4434092c482a93d8..941db8b3df45fd46cd87b50a5c86714b91dcde9c
    2024-06-30 19:26:27 UTC to 2024-06-20 18:43:18 UTC
    
    - Add a section for the never type change in e2024 (rust-lang/edition-guide#310)
    - Add 2024 unsafe attributes. (rust-lang/edition-guide#308)
    - Add 2024 unsafe extern blocks. (rust-lang/edition-guide#309)
    
    ## rust-lang/reference
    
    7 commits in 0b805c65804019b0ac8f2fe3117afad82a6069b8..1ae3deebc3ac16e276b6558e01420f8e605def08
    2024-06-29 16:59:51 UTC to 2024-06-18 22:16:37 UTC
    
    - Provide an example of `target_family` being multi-valued (rust-lang/reference#1518)
    - Remove stubs needed for the link checker. (rust-lang/reference#1517)
    - Document new `#[expect]` attribute and `reasons` parameter (RFC 2383) (rust-lang/reference#1237)
    - Update recognized tool attributes (rust-lang/reference#1498)
    - Add example of 1-ary tuple type (rust-lang/reference#1514)
    - underscore-expr: add more examples (rust-lang/reference#1478)
    - Remove outdated info about impl Trait in parameters and generics in the same function (rust-lang/reference#1495)
    
    ## rust-lang/rust-by-example
    
    4 commits in b1d97bd6113aba732b2091ce093c76f2d05bb8a0..658c6c27cb975b92227936024816986c2d3716fb
    2024-06-30 11:58:29 UTC to 2024-06-30 11:52:38 UTC
    
    - Remove awkward match in if_let (rust-lang/rust-by-example#1725)
    - Edit grammatical mistake (rust-lang/rust-by-example#1830)
    - Update paragraph in src/fn/diverging.md (rust-lang/rust-by-example#1853)
    - Fix minor typo in from_into.md (rust-lang/rust-by-example#1854)
    
    ## rust-lang/rustc-dev-guide
    
    11 commits in aec82168dd3121289a194b381f56076fc789a4d2..d6e3a32a557db5902e714604def8015d6bb7e0f7
    2024-07-01 10:51:26 UTC to 2024-06-18 18:24:17 UTC
    
    - Update new target check-cfg instructions (rust-lang/rustc-dev-guide#2006)
    - Add Rust for Linux integration tests documentation (rust-lang/rustc-dev-guide#2004)
    - Add docs for building Fuchsia locally and in CI (rust-lang/rustc-dev-guide#1989)
    - provide `libstdc++.so.6` through `LD_LIBRARY_PATH` (rust-lang/rustc-dev-guide#1999)
    - Document how to run `run-make` tests on Windows (rust-lang/rustc-dev-guide#2002)
    - Document `needs-symlink` directive (rust-lang/rustc-dev-guide#2001)
    - Rename `wasm32-wasi` to `wasm32-wasip1` (rust-lang/rustc-dev-guide#1678)
    - Document inert vs active attributes (rust-lang/rustc-dev-guide#1110)
    - Document hard-resetting submodules (rust-lang/rustc-dev-guide#2000)
    - Fix note about compiletest header `rustfix-only-machine-applicable` (rust-lang/rustc-dev-guide#1998)
    - Mention `RUSTC_ICE=0` to suppress ICE file (rust-lang/rustc-dev-guide#1997)
    matthiaskrgr authored Jul 2, 2024
    Configuration menu
    Copy the full SHA
    3bf5717 View commit details
    Browse the repository at this point in the history
  12. Rollup merge of rust-lang#127224 - tgross35:pretty-print-exhaustive, …

    …r=RalfJung
    
    Make `FloatTy` checks exhaustive in pretty print
    
    This should prevent the default fallback if we add more float types in the future.
    matthiaskrgr authored Jul 2, 2024
    Configuration menu
    Copy the full SHA
    5f17e5c View commit details
    Browse the repository at this point in the history
  13. Rollup merge of rust-lang#127230 - hattizai:patch01, r=saethlin

    chore: remove duplicate words
    
    remove duplicate words in comments to improve readability.
    matthiaskrgr authored Jul 2, 2024
    Configuration menu
    Copy the full SHA
    a10c231 View commit details
    Browse the repository at this point in the history
  14. Rollup merge of rust-lang#127243 - BoxyUwU:new_invalid_const_param_ty…

    …_test, r=compiler-errors
    
    Add test for adt_const_params
    
    Fixes rust-lang#84238
    
    r? `@compiler-errors`
    matthiaskrgr authored Jul 2, 2024
    Configuration menu
    Copy the full SHA
    6407580 View commit details
    Browse the repository at this point in the history