Closed
Description
I tried the following code:
$ cargo new hello-world
$ cd hello-world
In release mode, --remap-path-prefix
works correctly:
$ RUSTFLAGS="--remap-path-prefix=$(realpath .)=src --remap-path-prefix=$CARGO_HOME=cargo-home --remap-path-prefix=$RUSTUP_HOME=rustup-home" cargo run --release -q
Hello, world!
$ strings target/release/hello-world | grep joshua | wc -l
0
but the same thing without --release (and without incremental) does not:
$ CARGO_INCREMENTAL=0 RUSTFLAGS="--remap-path-prefix=$(realpath .)=src' --remap-path-prefix=$CARGO_HOME=cargo-home --remap-path-prefix=$RUSTUP_HOME=rustup-home" cargo run
Hello, world!
$ strings target/debug/hello-world | grep joshua | wc -l
8
Note this is unrelated to #66955 because incremental is disabled.
Originally posted by @jyn514 in #75263 (comment)