]> git.proxmox.com Git - cargo.git/commit - tests/testsuite/metadata.rs
Auto merge of #9226 - matklad:utf8everywhere, r=alexcrichton
authorbors <bors@rust-lang.org>
Tue, 2 Mar 2021 18:26:29 +0000 (18:26 +0000)
committerbors <bors@rust-lang.org>
Tue, 2 Mar 2021 18:26:29 +0000 (18:26 +0000)
commitc68432f1e5cbbc09833699a951b1b5b059651dff
treef6cec309df12727906b2ed2f8ee4e73853b8a3a1
parent5c74eb5707deb2c87d3bcad21e61af2e21f0b555
parentdd5806d146eaffec7e273e2b631b67a90f556203
Auto merge of #9226 - matklad:utf8everywhere, r=alexcrichton

Don't panic when printing JSON with non-utf8 paths

Before:

    λ cd \Xff/foo/ && cargo verify-project && cargo metadata
    {"success":"true"}
    warning: please specify `--format-version` flag explicitly to avoid compatibility problems
    thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: Error("path contains invalid UTF-8 characters", line: 0, column: 0)', /rustc/a5a775e3f9e8043dad405e00aee0ae60882a7b71/src/tools/cargo/src/cargo/core/shell.rs:346:51
    note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

After:

    λ cd \Xff/foo/ && $cargo verify-project && $cargo metadata
    {"success":"true"}
    warning: please specify `--format-version` flag explicitly to avoid compatibility problems
    error: path contains invalid UTF-8 characters

I am pretty  sure that this has zero real-world impact, but the diff is
small, so why not handle it?