Rustflags seems to be cached by Cargo

I add the asan(address sanitizer) to help me debug my unsafe codes, I tell rustc to use asan by writing this in the Cargo.toml:

[profile.dev]
rustflags = ["-Zsanitizer=address"]

but it seems that cargo cached this and even if I deleted these two line, the code still compile with asan, and if I change my rust from nightly to stable (asan can only be used in nightly for now), rustc throw an error (I'm already deleted any use of asan in my Cargo.toml):

error: the option Z is only accepted on the nightly compiler

It seems that cargo somehow cached the rustflags for me, is this by design or some bug?

Have you checked the modification is saved to the file system? Try open the file with something other than your main editor like cat or notepad.

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.