Skip to content

"cargo miri" has slightly different non-UTF-8 output than "cargo run" #1312

@RalfJung

Description

@RalfJung

Pointed out by @shepmaster in #1309 (comment): when putting

fn main() {
    let s = unsafe { std::str::from_utf8_unchecked(&[139, 50]) };
    println!("{}", s);
}

into a cargo project and doing cargo run -q vs cargo miri run -q, the output in raw bytes differs:

$ xxd run
00000000: 8b32 0a
$ xxd miri
00000000: efbf bd32 0a

Looks like the "8b" turns into "ef bf bd".

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-cargoArea: affects the cargo wrapper (cargo miri)C-bugCategory: This is a bug.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions