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 9 pull requests #99024

Merged
merged 21 commits into from
Jul 7, 2022
Merged

Rollup of 9 pull requests #99024

merged 21 commits into from
Jul 7, 2022

Commits on Jun 9, 2022

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

Commits on Jun 10, 2022

  1. Fix copy paste error

    AronParker committed Jun 10, 2022
    Configuration menu
    Copy the full SHA
    5d32f31 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    eb783d9 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    b13af73 View commit details
    Browse the repository at this point in the history

Commits on Jul 6, 2022

  1. interpret: use AllocRange in UninitByteAccess

    also use nice new format string syntax in interpret/error.rs
    RalfJung committed Jul 6, 2022
    Configuration menu
    Copy the full SHA
    27b7b3d View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    deaa92b View commit details
    Browse the repository at this point in the history

Commits on Jul 7, 2022

  1. add a test for rust-lang#80471

    TaKO8Ki committed Jul 7, 2022
    Configuration menu
    Copy the full SHA
    2a0e659 View commit details
    Browse the repository at this point in the history
  2. squash the commits

    implement detail_exit but I'm not sure it is right.
    
    not create new file and write detail exit in lib.rs
    
    replace std::process::exit to detail_exit
    
    that is not related to code runnning.
    
    remove pub
    kons-9 committed Jul 7, 2022
    Configuration menu
    Copy the full SHA
    d6de276 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    2f0ccdf View commit details
    Browse the repository at this point in the history
  4. add a test for rust-lang#70408

    TaKO8Ki committed Jul 7, 2022
    Configuration menu
    Copy the full SHA
    a80bb5b View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    111df9e View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    d96d541 View commit details
    Browse the repository at this point in the history
  7. Rollup merge of rust-lang#97917 - AronParker:master, r=ChrisDenton

    Implement ExitCodeExt for Windows
    
    Fixes rust-lang#97914
    
    ### Motivation:
    
    On Windows it is common for applications to return `HRESULT` (`i32`) or `DWORD` (`u32`) values. These stem from COM based components ([HRESULTS](https://docs.microsoft.com/en-us/windows/win32/api/objbase/nf-objbase-coinitialize)), Win32 errors ([GetLastError](https://docs.microsoft.com/en-us/windows/win32/api/errhandlingapi/nf-errhandlingapi-getlasterror)), GUI applications ([WM_QUIT](https://docs.microsoft.com/en-us/windows/win32/winmsg/wm-quit)) and more. The newly stabilized `ExitCode` provides an excellent fit for propagating these values, because `std::process::exit` does not run deconstructors which can result in errors. However, `ExitCode` currently only implements `From<u8> for ExitCode`, which disallows the full range of `i32`/`u32` values. This pull requests attempts to address that shortcoming by providing windows specific extensions that accept a `u32` value (which covers all possible `HRESULTS` and Win32 errors) analog to [ExitStatusExt::from_raw](https://doc.rust-lang.org/std/os/windows/process/trait.ExitStatusExt.html#tymethod.from_raw).
    
    This was also intended by the original Stabilization rust-lang#93840 (comment)  as pointed out by ``@eggyal`` in rust-lang#97914 (comment):
    
    > 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.__
    
    [Emphasis added]
    
    ### API
    
    ```rust
    /// Windows-specific extensions to [`process::ExitCode`].
    ///
    /// This trait is sealed: it cannot be implemented outside the standard library.
    /// This is so that future additional methods are not breaking changes.
    #[stable(feature = "windows_process_exit_code_from", since = "1.63.0")]
    pub trait ExitCodeExt: Sealed {
        /// Creates a new `ExitCode` from the raw underlying `u32` return value of
        /// a process.
        #[stable(feature = "windows_process_exit_code_from", since = "1.63.0")]
        fn from_raw(raw: u32) -> Self;
    }
    
    #[stable(feature = "windows_process_exit_code_from", since = "1.63.0")]
    impl ExitCodeExt for process::ExitCode {
        fn from_raw(raw: u32) -> Self {
            process::ExitCode::from_inner(From::from(raw))
        }
    }
    ```
    
    ### Misc
    
    I apologize in advance if I misplaced any attributes regarding stabilzation, as far as I learned traits are insta-stable so I chose to make them stable. If this is an error, please let me know and I'll correct it. I also added some additional machinery to make it work, analog to [ExitStatus](https://doc.rust-lang.org/std/process/struct.ExitStatus.html#).
    
    EDIT: Proposal: rust-lang/libs-team#48
    matthiaskrgr authored Jul 7, 2022
    Configuration menu
    Copy the full SHA
    6826f33 View commit details
    Browse the repository at this point in the history
  8. Rollup merge of rust-lang#98844 - cjgillot:deep-visit, r=jyn514

    Reword comments and rename HIR visiting methods.
    
    Sparked by this discussion in [zulip](https://rust-lang.zulipchat.com/#narrow/stream/182449-t-compiler.2Fhelp/topic/Confused.20by.20comment.20on.20.60deep_visit_item_likes_in_module.60)
    
    r? ``@jyn514`` ``@camsteffen``
    matthiaskrgr authored Jul 7, 2022
    Configuration menu
    Copy the full SHA
    8cc6bb3 View commit details
    Browse the repository at this point in the history
  9. Rollup merge of rust-lang#98979 - RalfJung:more-alloc-range, r=oli-obk

    interpret: use AllocRange in UninitByteAccess
    
    also use nice new format string syntax in `interpret/error.rs`, and use the `#` flag to add `0x` prefixes where applicable.
    
    r? ``@oli-obk``
    matthiaskrgr authored Jul 7, 2022
    Configuration menu
    Copy the full SHA
    9064147 View commit details
    Browse the repository at this point in the history
  10. Rollup merge of rust-lang#98986 - pierwill:patch-5, r=oli-obk

    Fix missing word in comment
    matthiaskrgr authored Jul 7, 2022
    Configuration menu
    Copy the full SHA
    b4f8537 View commit details
    Browse the repository at this point in the history
  11. Rollup merge of rust-lang#98994 - kons-9:dont_use_process_exit, r=jyn514

    replace process exit with more detailed exit in src/bootstrap/*.rs
    
    Fixes [rust-lang#98830](rust-lang#98830)
    
    I implemeted "detail_exit.rs" in lib.rs, and replace all of std::process::exit.
    So, error code should panic in test code.
    ```
    // lib.rs
    pub fn detail_exit(code: i32) -> ! {
        // Successful exit
        if code == 0 {
            std::process::exit(0);
        }
        if cfg!(test) {
            panic!("status code: {}", code);
        } else {
            std::panic::resume_unwind(Box::new(code));
        }
    }
    ```
    
    <details>
    <summary>% rg "exit\(" src/bootstrap/*.rs</summary>
    
    ```
    builder.rs
    351:            crate::detail_exit(1);
    1000:            crate::detail_exit(1);
    1429:                    crate::detail_exit(1);
    
    compile.rs
    1331:        crate::detail_exit(1);
    
    config.rs
    818:                    crate::detail_exit(2);
    1488:        crate::detail_exit(1);
    
    flags.rs
    263:                crate::detail_exit(exit_code);
    349:            crate::detail_exit(exit_code);
    381:            crate::detail_exit(1);
    602:                        crate::detail_exit(1);
    616:                crate::detail_exit(1);
    807:            crate::detail_exit(1);
    
    format.rs
    35:            crate::detail_exit(1);
    117:        crate::detail_exit(1);
    
    lib.rs
    714:            detail_exit(1);
    1620:                detail_exit(1);
    1651:pub fn detail_exit(code: i32) -> ! {
    1654:        std::process::exit(0);
    
    sanity.rs
    107:            crate::detail_exit(1);
    
    setup.rs
    97:        crate::detail_exit(1);
    290:            crate::detail_exit(1);
    
    test.rs
    676:            crate::detail_exit(1);
    1024:                crate::detail_exit(1);
    1254:            crate::detail_exit(1);
    
    tool.rs
    207:                crate::detail_exit(1);
    
    toolstate.rs
    96:    crate::detail_exit(3);
    111:            crate::detail_exit(1);
    182:            crate::detail_exit(1);
    228:            crate::detail_exit(1);
    
    util.rs
    339:        crate::detail_exit(1);
    378:        crate::detail_exit(1);
    468:    crate::detail_exit(1);
    ```
    </details>
    matthiaskrgr authored Jul 7, 2022
    Configuration menu
    Copy the full SHA
    6742dc4 View commit details
    Browse the repository at this point in the history
  12. Rollup merge of rust-lang#98995 - TaKO8Ki:add-test-for-80471, r=Mark-…

    …Simulacrum
    
    Add a test for rust-lang#80471
    
    Tests rust-lang#80471, but doesn't close it, see rust-lang#80471 (comment).
    matthiaskrgr authored Jul 7, 2022
    Configuration menu
    Copy the full SHA
    d0e6155 View commit details
    Browse the repository at this point in the history
  13. Rollup merge of rust-lang#99002 - fee1-dead-contrib:sugg_derive, r=mi…

    …chaelwoerister
    
    suggest adding a derive for #[default] applied to variants
    
    cc ``@TaKO8Ki`` as followup to rust-lang#98873.
    matthiaskrgr authored Jul 7, 2022
    Configuration menu
    Copy the full SHA
    7fed4ff View commit details
    Browse the repository at this point in the history
  14. Configuration menu
    Copy the full SHA
    16ad2f5 View commit details
    Browse the repository at this point in the history
  15. Rollup merge of rust-lang#99017 - GuillaumeGomez:rustdoc-ending-enum,…

    … r=notriddle
    
    Replace boolean argument for print_where_clause with an enum to make code more clear
    
    As you suggested ``@notriddle.`` Just not sure if the naming seems good to you?
    
    r? ``@notriddle``
    matthiaskrgr authored Jul 7, 2022
    Configuration menu
    Copy the full SHA
    ec0c156 View commit details
    Browse the repository at this point in the history