aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_db/src/input.rs
diff options
context:
space:
mode:
Diffstat (limited to 'crates/ra_db/src/input.rs')
-rw-r--r--crates/ra_db/src/input.rs9
1 files changed, 8 insertions, 1 deletions
diff --git a/crates/ra_db/src/input.rs b/crates/ra_db/src/input.rs
index 52f892891..5fd6edd78 100644
--- a/crates/ra_db/src/input.rs
+++ b/crates/ra_db/src/input.rs
@@ -9,6 +9,7 @@
9use relative_path::{RelativePath, RelativePathBuf}; 9use relative_path::{RelativePath, RelativePathBuf};
10use rustc_hash::FxHashMap; 10use rustc_hash::FxHashMap;
11 11
12use ra_cfg::CfgOptions;
12use ra_syntax::SmolStr; 13use ra_syntax::SmolStr;
13use rustc_hash::FxHashSet; 14use rustc_hash::FxHashSet;
14 15
@@ -109,11 +110,13 @@ struct CrateData {
109 file_id: FileId, 110 file_id: FileId,
110 edition: Edition, 111 edition: Edition,
111 dependencies: Vec<Dependency>, 112 dependencies: Vec<Dependency>,
113 cfg_options: CfgOptions,
112} 114}
113 115
114impl CrateData { 116impl CrateData {
115 fn new(file_id: FileId, edition: Edition) -> CrateData { 117 fn new(file_id: FileId, edition: Edition) -> CrateData {
116 CrateData { file_id, edition, dependencies: Vec::new() } 118 // FIXME: cfg options
119 CrateData { file_id, edition, dependencies: Vec::new(), cfg_options: CfgOptions::default() }
117 } 120 }
118 121
119 fn add_dep(&mut self, name: SmolStr, crate_id: CrateId) { 122 fn add_dep(&mut self, name: SmolStr, crate_id: CrateId) {
@@ -141,6 +144,10 @@ impl CrateGraph {
141 crate_id 144 crate_id
142 } 145 }
143 146
147 pub fn cfg_options(&self, crate_id: CrateId) -> &CfgOptions {
148 &self.arena[&crate_id].cfg_options
149 }
150
144 pub fn add_dep( 151 pub fn add_dep(
145 &mut self, 152 &mut self,
146 from: CrateId, 153 from: CrateId,