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 4 pull requests #95448

Merged
merged 13 commits into from
Mar 29, 2022
Merged

Rollup of 4 pull requests #95448

merged 13 commits into from
Mar 29, 2022

Commits on Feb 22, 2022

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

Commits on Mar 24, 2022

  1. Configuration menu
    Copy the full SHA
    b898ad4 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    09d83e2 View commit details
    Browse the repository at this point in the history

Commits on Mar 27, 2022

  1. Configuration menu
    Copy the full SHA
    dd6683f View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    07776c1 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    fc289a0 View commit details
    Browse the repository at this point in the history

Commits on Mar 28, 2022

  1. Touch up ExitCode docs

    coolreader18 authored and yaahc committed Mar 28, 2022
    Configuration menu
    Copy the full SHA
    97c58e8 View commit details
    Browse the repository at this point in the history

Commits on Mar 29, 2022

  1. Configuration menu
    Copy the full SHA
    0eea334 View commit details
    Browse the repository at this point in the history
  2. Indicate the correct error code in the compile_fail block.

    Co-authored-by: Mara Bos <m-ou.se@m-ou.se>
    thomcc and m-ou-se committed Mar 29, 2022
    Configuration menu
    Copy the full SHA
    3ac93ab View commit details
    Browse the repository at this point in the history
  3. Rollup merge of rust-lang#93840 - yaahc:termination-stabilization-cel…

    …ebration-station, r=joshtriplett
    
    Stabilize Termination and ExitCode
    
    From rust-lang#43301
    
    This PR stabilizes the Termination trait and associated ExitCode type. It also adjusts the ExitCode feature flag to replace the placeholder flag with a more permanent name, as well as splitting off the `to_i32` method behind its own permanently unstable feature flag.
    
    This PR stabilizes the termination trait with the following signature:
    
    ```rust
    pub trait Termination {
        fn report(self) -> ExitCode;
    }
    ```
    
    The existing impls of `Termination` are effectively already stable due to the prior stabilization of `?` in main.
    
    This PR also stabilizes the following APIs on exit code
    
    ```rust
    #[derive(Clone, Copy, Debug)]
    pub struct ExitCode(_);
    
    impl ExitCode {
        pub const SUCCESS: ExitCode;
        pub const FAILURE: ExitCode;
    }
    
    impl From<u8> for ExitCode { /* ... */ }
    ```
    
    ---
    
    All of the previous blockers have been resolved. The main ones that were resolved recently are:
    
    * The trait's name: We decided against changing this since none of the alternatives seemed particularly compelling. Instead we decided to end the bikeshedding and stick with the current name. ([link to the discussion](https://rust-lang.zulipchat.com/#narrow/stream/219381-t-libs/topic/Termination.2FExit.20Status.20Stabilization/near/269793887))
    * Issues around platform specific representations: We resolved this issue by changing the return type of `report` from `i32` to the opaque type `ExitCode`. That way we can change the underlying representation without affecting the API, letting us offer full support for platform specific exit code APIs in the future.
    * Custom exit codes: We resolved this by adding `From<u8> for ExitCode`. We choose to only support u8 initially because it is the least common denominator between the sets of exit codes supported by our current platforms. In the future we anticipate adding platform specific extension traits to ExitCode for constructors from larger or negative numbers, as needed.
    Dylan-DPC committed Mar 29, 2022
    Configuration menu
    Copy the full SHA
    bba2a64 View commit details
    Browse the repository at this point in the history
  4. Rollup merge of rust-lang#95256 - thomcc:fix-unwind-safe, r=m-ou-se

    Ensure io::Error's bitpacked repr doesn't accidentally impl UnwindSafe
    
    Sadly, I'm not sure how to easily test that we don't impl a trait, though (or can libstd use `where io::Error: !UnwindSafe` or something).
    
    Fixes rust-lang#95203
    Dylan-DPC committed Mar 29, 2022
    Configuration menu
    Copy the full SHA
    3208ed7 View commit details
    Browse the repository at this point in the history
  5. Rollup merge of rust-lang#95386 - compiler-errors:try-wrapping, r=oli…

    …-obk
    
    Suggest wrapping patterns in enum variants
    
    Structured suggestion to wrap a pattern in a single-field enum or struct:
    
    ```diff
     struct A;
    
     enum B {
       A(A),
     }
    
     fn main(b: B) {
       match b {
    -    A => {}
    +    B::A(A) => {}
       }
     }
    ```
    
    Half of rust-lang#94942, the other half I'm not exactly sure how to fix.
    
    Also includes two drive-by changes (that I am open to splitting out into another PR, but thought they could be rolled up into this one):
    - 07776c1: Makes sure not to suggest wrapping if it doesn't have tuple field constructor (i.e. has named fields)
    - 8f2bbb18fd53e5008bb488302dbd354577698ede: Also suggest wrapping expressions in a tuple struct (not just enum variants)
    Dylan-DPC committed Mar 29, 2022
    Configuration menu
    Copy the full SHA
    a0d2862 View commit details
    Browse the repository at this point in the history
  6. Rollup merge of rust-lang#95437 - notriddle:notriddle/issue-79076, r=…

    …compiler-errors
    
    diagnostics: regression test for derive bounds
    
    Closes rust-lang#79076
    Dylan-DPC committed Mar 29, 2022
    Configuration menu
    Copy the full SHA
    2471502 View commit details
    Browse the repository at this point in the history