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 #117249

Merged
merged 24 commits into from Oct 27, 2023
Merged

Rollup of 6 pull requests #117249

merged 24 commits into from Oct 27, 2023

Commits on Oct 20, 2023

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

Commits on Oct 22, 2023

  1. Configuration menu
    Copy the full SHA
    24cdb27 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    8716890 View commit details
    Browse the repository at this point in the history

Commits on Oct 23, 2023

  1. When expecting closure argument but finding block provide suggestion

    Detect if there is a potential typo where the `{` meant to open the
    closure body was written before the body.
    
    ```
    error[E0277]: expected a `FnOnce<({integer},)>` closure, found `Option<usize>`
      --> $DIR/ruby_style_closure_successful_parse.rs:3:31
       |
    LL |       let p = Some(45).and_then({|x|
       |  ______________________--------_^
       | |                      |
       | |                      required by a bound introduced by this call
    LL | |         1 + 1;
    LL | |         Some(x * 2)
       | |         ----------- this tail expression is of type `Option<usize>`
    LL | |     });
       | |_____^ expected an `FnOnce<({integer},)>` closure, found `Option<usize>`
       |
       = help: the trait `FnOnce<({integer},)>` is not implemented for `Option<usize>`
    note: required by a bound in `Option::<T>::and_then`
      --> $SRC_DIR/core/src/option.rs:LL:COL
    help: you might have meant to open the closure body instead of placing a closure within a block
       |
    LL -     let p = Some(45).and_then({|x|
    LL +     let p = Some(45).and_then(|x| {
       |
    ```
    
    Detect the potential typo where the closure header is missing.
    
    ```
    error[E0277]: expected a `FnOnce<(&bool,)>` closure, found `bool`
      --> $DIR/block_instead_of_closure_in_arg.rs:3:23
       |
    LL |        Some(true).filter({
       |  _________________------_^
       | |                 |
       | |                 required by a bound introduced by this call
    LL | |/         if number % 2 == 0 {
    LL | ||             number == 0
    LL | ||         } else {
    LL | ||             number != 0
    LL | ||         }
       | ||_________- this tail expression is of type `bool`
    LL | |      });
       | |______^ expected an `FnOnce<(&bool,)>` closure, found `bool`
       |
       = help: the trait `for<'a> FnOnce<(&'a bool,)>` is not implemented for `bool`
    note: required by a bound in `Option::<T>::filter`
      --> $SRC_DIR/core/src/option.rs:LL:COL
    help: you might have meant to create the closure instead of a block
       |
    LL |     Some(true).filter(|_| {
       |                       +++
    ```
    
    Partially address rust-lang#27300.
    estebank committed Oct 23, 2023
    Configuration menu
    Copy the full SHA
    c1bfd46 View commit details
    Browse the repository at this point in the history

Commits on Oct 24, 2023

  1. Redo stringify.rs test.

    Currently it only tests AST pretty-printing. This commit changes it to
    run every example through both AST pretty-printing and TokenStream
    pretty-printing. This makes it clear where there two pretty-printing
    approaches produce different results.
    nnethercote committed Oct 24, 2023
    Configuration menu
    Copy the full SHA
    f0a2635 View commit details
    Browse the repository at this point in the history
  2. Augment stringify.rs test.

    By adding tests (or placeholders, or comments) for missing AST variants.
    nnethercote committed Oct 24, 2023
    Configuration menu
    Copy the full SHA
    2e2e780 View commit details
    Browse the repository at this point in the history
  3. Augment stringify.rs test some more.

    By making some case more complex, adding some new cases, tweaking
    formatting, and removing unnecessary `rustfmt` attributes.
    nnethercote committed Oct 24, 2023
    Configuration menu
    Copy the full SHA
    c1800fb View commit details
    Browse the repository at this point in the history

Commits on Oct 26, 2023

  1. Configuration menu
    Copy the full SHA
    173dcb2 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    ba17934 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    95742ff View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    8dea49a View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    726a43c View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    65f0253 View commit details
    Browse the repository at this point in the history
  7. Configuration menu
    Copy the full SHA
    1078250 View commit details
    Browse the repository at this point in the history
  8. Configuration menu
    Copy the full SHA
    5563a9b View commit details
    Browse the repository at this point in the history
  9. Configuration menu
    Copy the full SHA
    ac4fa3f View commit details
    Browse the repository at this point in the history
  10. Fix symbols::tests::test_symbols

        ---- symbols::tests::test_symbols stdout ----
        thread 'symbols::tests::test_symbols' panicked at library/proc_macro/src/bridge/client.rs:311:17:
        procedural macro API is used outside of a procedural macro
    dtolnay committed Oct 26, 2023
    Configuration menu
    Copy the full SHA
    c1552df View commit details
    Browse the repository at this point in the history
  11. Configuration menu
    Copy the full SHA
    94ecabf View commit details
    Browse the repository at this point in the history
  12. Rollup merge of rust-lang#116968 - eopb:116967, r=petrochenkov

    Invalid `?` suggestion on mismatched `Ok(T)`
    
    fixes: rust-lang#116967
    matthiaskrgr committed Oct 26, 2023
    Configuration menu
    Copy the full SHA
    934cbe4 View commit details
    Browse the repository at this point in the history
  13. Rollup merge of rust-lang#117032 - bjorn3:riscv64_enable_cg_clif_test…

    …s, r=petrochenkov
    
    Enable cg_clif tests for riscv64gc
    
    Cranelift now has support for riscv64 on Linux.
    matthiaskrgr committed Oct 26, 2023
    Configuration menu
    Copy the full SHA
    596369f View commit details
    Browse the repository at this point in the history
  14. Rollup merge of rust-lang#117106 - estebank:issue-27300, r=petrochenkov

    When expecting closure argument but finding block provide suggestion
    
    Detect if there is a potential typo where the `{` meant to open the closure body was written before the body.
    
    ```
    error[E0277]: expected a `FnOnce<({integer},)>` closure, found `Option<usize>`
      --> $DIR/ruby_style_closure_successful_parse.rs:3:31
       |
    LL |       let p = Some(45).and_then({|x|
       |  ______________________--------_^
       | |                      |
       | |                      required by a bound introduced by this call
    LL | |         1 + 1;
    LL | |         Some(x * 2)
       | |         ----------- this tail expression is of type `Option<usize>`
    LL | |     });
       | |_____^ expected an `FnOnce<({integer},)>` closure, found `Option<usize>`
       |
       = help: the trait `FnOnce<({integer},)>` is not implemented for `Option<usize>`
    note: required by a bound in `Option::<T>::and_then`
      --> $SRC_DIR/core/src/option.rs:LL:COL
    help: you might have meant to open the closure body instead of placing a closure within a block
       |
    LL -     let p = Some(45).and_then({|x|
    LL +     let p = Some(45).and_then(|x| {
       |
    ```
    
    Detect the potential typo where the closure header is missing.
    
    ```
    error[E0277]: expected a `FnOnce<(&bool,)>` closure, found `bool`
      --> $DIR/block_instead_of_closure_in_arg.rs:3:23
       |
    LL |        Some(true).filter({
       |  _________________------_^
       | |                 |
       | |                 required by a bound introduced by this call
    LL | |/         if number % 2 == 0 {
    LL | ||             number == 0
    LL | ||         } else {
    LL | ||             number != 0
    LL | ||         }
       | ||_________- this tail expression is of type `bool`
    LL | |      });
       | |______^ expected an `FnOnce<(&bool,)>` closure, found `bool`
       |
       = help: the trait `for<'a> FnOnce<(&'a bool,)>` is not implemented for `bool`
    note: required by a bound in `Option::<T>::filter`
      --> $SRC_DIR/core/src/option.rs:LL:COL
    help: you might have meant to create the closure instead of a block
       |
    LL |     Some(true).filter(|_| {
       |                       +++
    ```
    
    Partially address rust-lang#27300. Fix rust-lang#104690.
    matthiaskrgr committed Oct 26, 2023
    Configuration menu
    Copy the full SHA
    d09c988 View commit details
    Browse the repository at this point in the history
  15. Rollup merge of rust-lang#117114 - nnethercote:improve-stringify-test…

    …, r=petrochenkov
    
    Improve `stringify.rs` test
    
    Best reviewed one commit at a time.
    
    r? `@petrochenkov`
    matthiaskrgr committed Oct 26, 2023
    Configuration menu
    Copy the full SHA
    a8f7acd View commit details
    Browse the repository at this point in the history
  16. Rollup merge of rust-lang#117188 - dtolnay:symbolenv, r=cjgillot

    Avoid repeated interning of `env!("CFG_RELEASE")`
    
    Implements `@cjgillot's` suggestion from rust-lang#117148 (comment).
    matthiaskrgr committed Oct 26, 2023
    Configuration menu
    Copy the full SHA
    2656c98 View commit details
    Browse the repository at this point in the history
  17. Rollup merge of rust-lang#117243 - chfogelman:replace-not-swap-commen…

    …t, r=thomcc
    
    Explain implementation of mem::replace
    
    This adds a comment to explain why `mem::replace` is not implemented in terms of `mem::swap` to prevent [naïfs like me](rust-lang#117189) from trying to "fix" it.
    matthiaskrgr committed Oct 26, 2023
    Configuration menu
    Copy the full SHA
    c0b1c1a View commit details
    Browse the repository at this point in the history