1 // rustfmt-error_on_line_overflow: false
4 let (opts, rustflags, clear_env_rust_log) = {
5 // We mustn't lock configuration for the whole build process
6 let rls_config = rls_config.lock().unwrap();
8 let opts = CargoOptions::new(&rls_config);
9 trace!("Cargo compilation options:\n{:?}", opts);
10 let rustflags = prepare_cargo_rustflags(&rls_config);
12 // Warn about invalid specified bin target or package depending on current mode
13 // TODO: Return client notifications along with diagnostics to inform the user
14 if !rls_config.workspace_mode {
15 let cur_pkg_targets = ws.current().unwrap().targets();
17 if let &Some(ref build_bin) = rls_config.build_bin.as_ref() {
18 let mut bins = cur_pkg_targets.iter().filter(|x| x.is_bin());
19 if let None = bins.find(|x| x.name() == build_bin) {
21 "cargo - couldn't find binary `{}` specified in `build_bin` configuration",
27 for package in &opts.package {
28 if let None = ws.members().find(|x| x.name() == package) {
29 warn!("cargo - couldn't find member package `{}` specified in `analyze_package` configuration", package);
34 (opts, rustflags, rls_config.clear_env_rust_log)