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 5 pull requests #98025

Merged
merged 10 commits into from
Jun 12, 2022
Merged

Rollup of 5 pull requests #98025

merged 10 commits into from
Jun 12, 2022

Commits on Jun 9, 2022

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

Commits on Jun 10, 2022

  1. Do not panic in Termination impl on closed stderr

    Repro:
    
        #![feature(backtrace)]
    
        use std::backtrace::Backtrace;
        use std::io::{self, Write as _};
        use std::panic::{self, PanicInfo};
    
        #[derive(Debug)]
        pub struct Error;
    
        fn panic_hook(panic_info: &PanicInfo) {
            let backtrace = Backtrace::force_capture();
            let _ = write!(io::stdout(), "{}\n{}", panic_info, backtrace);
        }
    
        fn main() -> Result<(), Error> {
            panic::set_hook(Box::new(panic_hook));
            let stderr = io::stderr();
            let mut stderr = stderr.lock();
            while stderr.write_all(b".\n").is_ok() {}
            Err(Error)
        }
    
    Before:
    
        $ RUST_BACKTRACE=1 target/debug/testing 3>&2 2>&1 1>&3 | head
        .
        .
        .
        .
        .
        .
        .
        .
        .
        .
        panicked at 'failed printing to stderr: Broken pipe (os error 32)', library/std/src/io/stdio.rs:1016:9
           0: testing::panic_hook
                     at ./src/main.rs:11:21
           1: core::ops::function::Fn::call
                     at /git/rust/library/core/src/ops/function.rs:77:5
           2: std::panicking::rust_panic_with_hook
           3: std::panicking::begin_panic_handler::{{closure}}
           4: std::sys_common::backtrace::__rust_end_short_backtrace
           5: rust_begin_unwind
           6: core::panicking::panic_fmt
           7: std::io::stdio::_eprint
           8: <core::result::Result<!,E> as std::process::Termination>::report
                     at /git/rust/library/std/src/process.rs:2164:9
           9: <core::result::Result<(),E> as std::process::Termination>::report
                     at /git/rust/library/std/src/process.rs:2148:25
          10: std::rt::lang_start::{{closure}}
                     at /git/rust/library/std/src/rt.rs:145:18
          11: std::rt::lang_start_internal
          12: std::rt::lang_start
                     at /git/rust/library/std/src/rt.rs:144:17
          13: main
          14: __libc_start_main
                     at /build/glibc-SzIz7B/glibc-2.31/csu/../csu/libc-start.c:308:16
          15: _start
    
    After:
    
        $ RUST_BACKTRACE=1 target/debug/testing 3>&2 2>&1 1>&3 | head
        .
        .
        .
        .
        .
        .
        .
        .
        .
        .
    dtolnay committed Jun 10, 2022
    Configuration menu
    Copy the full SHA
    563aa12 View commit details
    Browse the repository at this point in the history

Commits on Jun 11, 2022

  1. Configuration menu
    Copy the full SHA
    8558b35 View commit details
    Browse the repository at this point in the history
  2. Stabilize scoped threads.

    m-ou-se committed Jun 11, 2022
    Configuration menu
    Copy the full SHA
    ae0a533 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    acab446 View commit details
    Browse the repository at this point in the history

Commits on Jun 12, 2022

  1. Rollup merge of rust-lang#97921 - bvanjoi:docs-example-str-replace, r…

    …=Dylan-DPC
    
    additional docs example for replace **all** of str
    Dylan-DPC committed Jun 12, 2022
    Configuration menu
    Copy the full SHA
    b2172b7 View commit details
    Browse the repository at this point in the history
  2. Rollup merge of rust-lang#97970 - dtolnay:terminate, r=joshtriplett

    Fix Termination impl panic on closed stderr
    
    Repro:
    
    ```rust
    #![feature(backtrace)]
    
    use std::backtrace::Backtrace;
    use std::io::{self, Write as _};
    use std::panic::{self, PanicInfo};
    
    #[derive(Debug)]
    pub struct Error;
    
    fn panic_hook(panic_info: &PanicInfo) {
        let backtrace = Backtrace::force_capture();
        let _ = write!(io::stdout(), "{}\n{}", panic_info, backtrace);
    }
    
    fn main() -> Result<(), Error> {
        panic::set_hook(Box::new(panic_hook));
        let stderr = io::stderr();
        let mut stderr = stderr.lock();
        while stderr.write_all(b".\n").is_ok() {}
        Err(Error)
    }
    ```
    
    ### Before:
    
    ```console
    $ target/debug/repro 3>&2 2>&1 1>&3 | head
    .
    .
    .
    .
    .
    .
    .
    .
    .
    .
    panicked at 'failed printing to stderr: Broken pipe (os error 32)', library/std/src/io/stdio.rs:1016:9
       0: testing::panic_hook
                 at ./src/main.rs:11:21
       1: core::ops::function::Fn::call
                 at /git/rust/library/core/src/ops/function.rs:77:5
       2: std::panicking::rust_panic_with_hook
       3: std::panicking::begin_panic_handler::{{closure}}
       4: std::sys_common::backtrace::__rust_end_short_backtrace
       5: rust_begin_unwind
       6: core::panicking::panic_fmt
       7: std::io::stdio::_eprint
       8: <core::result::Result<!,E> as std::process::Termination>::report
                 at /git/rust/library/std/src/process.rs:2164:9
       9: <core::result::Result<(),E> as std::process::Termination>::report
                 at /git/rust/library/std/src/process.rs:2148:25
      10: std::rt::lang_start::{{closure}}
                 at /git/rust/library/std/src/rt.rs:145:18
      11: std::rt::lang_start_internal
      12: std::rt::lang_start
                 at /git/rust/library/std/src/rt.rs:144:17
      13: main
      14: __libc_start_main
                 at /build/glibc-SzIz7B/glibc-2.31/csu/../csu/libc-start.c:308:16
      15: _start
    ```
    
    ### After:
    
    ```console
    $ target/debug/repro 3>&2 2>&1 1>&3 | head
    .
    .
    .
    .
    .
    .
    .
    .
    .
    .
    ```
    Dylan-DPC committed Jun 12, 2022
    Configuration menu
    Copy the full SHA
    cf3c41a View commit details
    Browse the repository at this point in the history
  3. Rollup merge of rust-lang#97991 - davidkna:fix-macos-strip, r=joshtri…

    …plett
    
    Use safer `strip=symbols`-flag for dylibs on macOS
    
    Closes rust-lang#93988
    
    To safely strip dylibs on macOS, the `-x` flag is needed per the manpage (see the discussion here: rust-lang#93988 (comment)).
    
    Thus, when the current `crate_type` is producing a dylib (I assume this is the case for proc macros) use the `-x` flag instead of bare `strip` for `strip=symbols`.
    Dylan-DPC committed Jun 12, 2022
    Configuration menu
    Copy the full SHA
    265e0f0 View commit details
    Browse the repository at this point in the history
  4. Rollup merge of rust-lang#97992 - m-ou-se:stabilize-scoped-threads, r…

    …=joshtriplett
    
    Stabilize scoped threads.
    
    Tracking issue: rust-lang#93203
    
    FCP finished here: rust-lang#93203 (comment)
    Dylan-DPC committed Jun 12, 2022
    Configuration menu
    Copy the full SHA
    a24ca03 View commit details
    Browse the repository at this point in the history
  5. Rollup merge of rust-lang#98012 - compiler-errors:poly-trait-refs-are…

    …-traits, r=cjgillot
    
    `ValuePairs::PolyTraitRefs` should be called "trait"s in type error diagnostics
    
    Pretty simple, we already do this for `ValuePairs::TraitRefs`...
    Dylan-DPC committed Jun 12, 2022
    Configuration menu
    Copy the full SHA
    53090fe View commit details
    Browse the repository at this point in the history