I was getting errors from rust-analyzer because it was apparently analyzing cfg(test), where of course, not everything is used. I found these settings in my settings.json file online that helped with that:
"rust-analyzer.check.allTargets": false,
"rust-analyzer.check.extraArgs": [
"--target",
"thumbv8m.main-none-eabihf",
],
"rust-analyzer.cargo.target": "thumbv8m.main-none-eabihf",
But it is still dimming my main function as dead code because I had to mark it with #[cfg(not(test))] so it would not conflict with the defmt-test harness. How can I fix this?