From 857f419c9ded5ebeab428535729b57687499d3a6 Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Tue, 8 Oct 2019 14:43:29 +0300 Subject: hard-code nightly-only CFGs --- crates/ra_project_model/src/lib.rs | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'crates/ra_project_model/src') diff --git a/crates/ra_project_model/src/lib.rs b/crates/ra_project_model/src/lib.rs index a4d117e34..8b8663a78 100644 --- a/crates/ra_project_model/src/lib.rs +++ b/crates/ra_project_model/src/lib.rs @@ -320,6 +320,14 @@ fn find_cargo_toml(path: &Path) -> Result { pub fn get_rustc_cfg_options() -> CfgOptions { let mut cfg_options = CfgOptions::default(); + // Some nightly-only cfgs, which are required for stdlib + { + cfg_options.insert_atom("target_thread_local".into()); + for &target_has_atomic in ["16", "32", "64", "8", "cas", "ptr"].iter() { + cfg_options.insert_key_value("target_has_atomic".into(), target_has_atomic.into()) + } + } + match (|| -> Result<_> { // `cfg(test)` and `cfg(debug_assertion)` are handled outside, so we suppress them here. let output = Command::new("rustc").args(&["--print", "cfg", "-O"]).output()?; -- cgit v1.2.3