]> git.proxmox.com Git - rustc.git/blame - src/tools/rustfmt/tests/source/issue-2179/one.rs
New upstream version 1.52.1+dfsg1
[rustc.git] / src / tools / rustfmt / tests / source / issue-2179 / one.rs
CommitLineData
f20569fa
XL
1// rustfmt-version: One
2// rustfmt-error_on_line_overflow: false
3
4fn issue_2179() {
5 let (opts, rustflags, clear_env_rust_log) =
6 {
7 // We mustn't lock configuration for the whole build process
8 let rls_config = rls_config.lock().unwrap();
9
10 let opts = CargoOptions::new(&rls_config);
11 trace!("Cargo compilation options:\n{:?}", opts);
12 let rustflags = prepare_cargo_rustflags(&rls_config);
13
14 // Warn about invalid specified bin target or package depending on current mode
15 // TODO: Return client notifications along with diagnostics to inform the user
16 if !rls_config.workspace_mode {
17 let cur_pkg_targets = ws.current().unwrap().targets();
18
19 if let &Some(ref build_bin) = rls_config.build_bin.as_ref() {
20 let mut bins = cur_pkg_targets.iter().filter(|x| x.is_bin());
21 if let None = bins.find(|x| x.name() == build_bin) {
22 warn!("cargo - couldn't find binary `{}` specified in `build_bin` configuration", build_bin);
23 }
24 }
25 } else {
26 for package in &opts.package {
27 if let None = ws.members().find(|x| x.name() == package) {
28 warn!("cargo - couldn't find member package `{}` specified in `analyze_package` configuration", package);
29 }
30 }
31 }
32
33 (opts, rustflags, rls_config.clear_env_rust_log)
34 };
35
36}