Skip to content

std::run functions fail after io_error #10754

Closed
@klutzy

Description

@klutzy
use std::io;
use std::run;

fn main() {
    io::io_error::cond.trap(|_| {}).inside({
        || {
            let opts = run::ProcessOptions::new();
            let _ = run::Process::new("", [], opts); // io_error
        }
    })
}

Result:

task '<main>' failed at 'called `Option::unwrap()` on a `None` value', C:\home\stone\rust-vanilla\src\libstd\option.rs:135

Similarly std::run::{process_status, process_output} fails if it fails to make new process.

Previously #10654 suggested a potential fix using Result but the patch would sound after #10449 lands.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions