`debug = true` does not generate debug info for test build

I have tests in main.rs which uses some libraries.
I put debug = true in [profile.release] and compiled the crate:
cargo build --release --tests --target=thumbv8m.main-none-eabi -Z build-std=core,alloc

If I examine the test binary generated in target/thumbv8m.main-none-eabi/release/deps, it does not seem to generate debug info for main.rs, although it is generated for the libraries. But putting -g in rustflags does generate debug info for main.rs

I wonder if it is a bug, or an intended behavior.

Note that I'm using thumbv8m.main-none-eabi target, and using custom_test_frameworks so the above may not be the general case.

This topic was automatically closed 90 days after the last reply. We invite you to open a new topic if you have further questions or comments.