6324: Improve #[cfg] diagnostics r=jonas-schievink a=jonas-schievink

Unfortunately I ran into https://github.com/rust-analyzer/rust-analyzer/issues/4058 while testing this on https://github.com/nrf-rs/nrf-hal/, so I didn't see much of it in action yet, but it does seem to work.

Co-authored-by: Jonas Schievink <jonas.schievink@ferrous-systems.com>
Co-authored-by: Jonas Schievink <jonasschievink@gmail.com>
This commit is contained in:
bors[bot]
2020-10-23 10:38:30 +00:00
committed by GitHub
15 changed files with 816 additions and 140 deletions

View File

@@ -762,7 +762,7 @@ pub(crate) fn runnable(
let workspace_root = spec.as_ref().map(|it| it.workspace_root.clone());
let target = spec.as_ref().map(|s| s.target.clone());
let (cargo_args, executable_args) =
CargoTargetSpec::runnable_args(snap, spec, &runnable.kind, &runnable.cfg_exprs)?;
CargoTargetSpec::runnable_args(snap, spec, &runnable.kind, &runnable.cfg)?;
let label = runnable.label(target);
let location = location_link(snap, None, runnable.nav)?;