diff options
author | Florian Diebold <[email protected]> | 2019-05-01 19:50:49 +0100 |
---|---|---|
committer | Florian Diebold <[email protected]> | 2019-05-04 17:18:30 +0100 |
commit | 0f34568924019caf1ed63c84143c12156b963abf (patch) | |
tree | ce94360052412dfe59b2eb4074b5011f4b54e301 | |
parent | 7310f3f801a8dff37503dd4ed3e3e2ecbf6bac2e (diff) |
Turn eprintln!s into debug!s
-rw-r--r-- | crates/ra_hir/src/ty/traits.rs | 5 | ||||
-rw-r--r-- | crates/ra_hir/src/ty/traits/chalk.rs | 15 |
2 files changed, 12 insertions, 8 deletions
diff --git a/crates/ra_hir/src/ty/traits.rs b/crates/ra_hir/src/ty/traits.rs index c707110ad..a1ed0c028 100644 --- a/crates/ra_hir/src/ty/traits.rs +++ b/crates/ra_hir/src/ty/traits.rs | |||
@@ -1,6 +1,7 @@ | |||
1 | //! Trait solving using Chalk. | 1 | //! Trait solving using Chalk. |
2 | use std::sync::{Arc, Mutex}; | 2 | use std::sync::{Arc, Mutex}; |
3 | 3 | ||
4 | use log::debug; | ||
4 | use chalk_ir::cast::Cast; | 5 | use chalk_ir::cast::Cast; |
5 | 6 | ||
6 | use crate::{Crate, Trait, db::HirDatabase, ImplBlock}; | 7 | use crate::{Crate, Trait, db::HirDatabase, ImplBlock}; |
@@ -52,7 +53,7 @@ fn solve( | |||
52 | let context = ChalkContext { db, krate }; | 53 | let context = ChalkContext { db, krate }; |
53 | let solver = db.solver(krate); | 54 | let solver = db.solver(krate); |
54 | let solution = solver.lock().unwrap().solve(&context, goal); | 55 | let solution = solver.lock().unwrap().solve(&context, goal); |
55 | eprintln!("solve({:?}) => {:?}", goal, solution); | 56 | debug!("solve({:?}) => {:?}", goal, solution); |
56 | solution | 57 | solution |
57 | } | 58 | } |
58 | 59 | ||
@@ -73,7 +74,7 @@ pub(crate) fn implements( | |||
73 | trait_ref: Canonical<TraitRef>, | 74 | trait_ref: Canonical<TraitRef>, |
74 | ) -> Option<Solution> { | 75 | ) -> Option<Solution> { |
75 | let goal: chalk_ir::Goal = trait_ref.value.to_chalk(db).cast(); | 76 | let goal: chalk_ir::Goal = trait_ref.value.to_chalk(db).cast(); |
76 | eprintln!("goal: {:?}", goal); | 77 | debug!("goal: {:?}", goal); |
77 | let env = chalk_ir::Environment::new(); | 78 | let env = chalk_ir::Environment::new(); |
78 | let in_env = chalk_ir::InEnvironment::new(&env, goal); | 79 | let in_env = chalk_ir::InEnvironment::new(&env, goal); |
79 | let parameter = chalk_ir::ParameterKind::Ty(chalk_ir::UniverseIndex::ROOT); | 80 | let parameter = chalk_ir::ParameterKind::Ty(chalk_ir::UniverseIndex::ROOT); |
diff --git a/crates/ra_hir/src/ty/traits/chalk.rs b/crates/ra_hir/src/ty/traits/chalk.rs index 02df5a4fa..1adc1d601 100644 --- a/crates/ra_hir/src/ty/traits/chalk.rs +++ b/crates/ra_hir/src/ty/traits/chalk.rs | |||
@@ -1,6 +1,8 @@ | |||
1 | //! Conversion code from/to Chalk. | 1 | //! Conversion code from/to Chalk. |
2 | use std::sync::Arc; | 2 | use std::sync::Arc; |
3 | 3 | ||
4 | use log::debug; | ||
5 | |||
4 | use chalk_ir::{TypeId, ImplId, TypeKindId, ProjectionTy, Parameter, Identifier, cast::Cast, PlaceholderIndex, UniverseIndex, TypeName}; | 6 | use chalk_ir::{TypeId, ImplId, TypeKindId, ProjectionTy, Parameter, Identifier, cast::Cast, PlaceholderIndex, UniverseIndex, TypeName}; |
5 | use chalk_rust_ir::{AssociatedTyDatum, TraitDatum, StructDatum, ImplDatum}; | 7 | use chalk_rust_ir::{AssociatedTyDatum, TraitDatum, StructDatum, ImplDatum}; |
6 | 8 | ||
@@ -65,6 +67,7 @@ impl ToChalk for Ty { | |||
65 | } | 67 | } |
66 | } | 68 | } |
67 | 69 | ||
70 | // TODO merge this into the ToChalk implementation for Ty | ||
68 | impl ToChalk for ApplicationTy { | 71 | impl ToChalk for ApplicationTy { |
69 | type Chalk = chalk_ir::ApplicationTy; | 72 | type Chalk = chalk_ir::ApplicationTy; |
70 | 73 | ||
@@ -173,7 +176,7 @@ where | |||
173 | unimplemented!() | 176 | unimplemented!() |
174 | } | 177 | } |
175 | fn trait_datum(&self, trait_id: chalk_ir::TraitId) -> Arc<TraitDatum> { | 178 | fn trait_datum(&self, trait_id: chalk_ir::TraitId) -> Arc<TraitDatum> { |
176 | eprintln!("trait_datum {:?}", trait_id); | 179 | debug!("trait_datum {:?}", trait_id); |
177 | let trait_: Trait = from_chalk(self.db, trait_id); | 180 | let trait_: Trait = from_chalk(self.db, trait_id); |
178 | let generic_params = trait_.generic_params(self.db); | 181 | let generic_params = trait_.generic_params(self.db); |
179 | let bound_vars = Substs::bound_vars(&generic_params); | 182 | let bound_vars = Substs::bound_vars(&generic_params); |
@@ -191,7 +194,7 @@ where | |||
191 | Arc::new(trait_datum) | 194 | Arc::new(trait_datum) |
192 | } | 195 | } |
193 | fn struct_datum(&self, struct_id: chalk_ir::StructId) -> Arc<StructDatum> { | 196 | fn struct_datum(&self, struct_id: chalk_ir::StructId) -> Arc<StructDatum> { |
194 | eprintln!("struct_datum {:?}", struct_id); | 197 | debug!("struct_datum {:?}", struct_id); |
195 | let type_ctor = from_chalk(self.db, struct_id); | 198 | let type_ctor = from_chalk(self.db, struct_id); |
196 | // TODO might be nicer if we can create a fake GenericParams for the TypeCtor | 199 | // TODO might be nicer if we can create a fake GenericParams for the TypeCtor |
197 | let (num_params, upstream) = match type_ctor { | 200 | let (num_params, upstream) = match type_ctor { |
@@ -232,7 +235,7 @@ where | |||
232 | Arc::new(struct_datum) | 235 | Arc::new(struct_datum) |
233 | } | 236 | } |
234 | fn impl_datum(&self, impl_id: ImplId) -> Arc<ImplDatum> { | 237 | fn impl_datum(&self, impl_id: ImplId) -> Arc<ImplDatum> { |
235 | eprintln!("impl_datum {:?}", impl_id); | 238 | debug!("impl_datum {:?}", impl_id); |
236 | let impl_block: ImplBlock = from_chalk(self.db, impl_id); | 239 | let impl_block: ImplBlock = from_chalk(self.db, impl_id); |
237 | let generic_params = impl_block.generic_params(self.db); | 240 | let generic_params = impl_block.generic_params(self.db); |
238 | let bound_vars = Substs::bound_vars(&generic_params); | 241 | let bound_vars = Substs::bound_vars(&generic_params); |
@@ -256,7 +259,7 @@ where | |||
256 | Arc::new(impl_datum) | 259 | Arc::new(impl_datum) |
257 | } | 260 | } |
258 | fn impls_for_trait(&self, trait_id: chalk_ir::TraitId) -> Vec<ImplId> { | 261 | fn impls_for_trait(&self, trait_id: chalk_ir::TraitId) -> Vec<ImplId> { |
259 | eprintln!("impls_for_trait {:?}", trait_id); | 262 | debug!("impls_for_trait {:?}", trait_id); |
260 | let trait_ = from_chalk(self.db, trait_id); | 263 | let trait_ = from_chalk(self.db, trait_id); |
261 | self.db | 264 | self.db |
262 | .impls_for_trait(self.krate, trait_) | 265 | .impls_for_trait(self.krate, trait_) |
@@ -273,7 +276,7 @@ where | |||
273 | auto_trait_id: chalk_ir::TraitId, | 276 | auto_trait_id: chalk_ir::TraitId, |
274 | struct_id: chalk_ir::StructId, | 277 | struct_id: chalk_ir::StructId, |
275 | ) -> bool { | 278 | ) -> bool { |
276 | eprintln!("impl_provided_for {:?}, {:?}", auto_trait_id, struct_id); | 279 | debug!("impl_provided_for {:?}, {:?}", auto_trait_id, struct_id); |
277 | false // FIXME | 280 | false // FIXME |
278 | } | 281 | } |
279 | fn type_name(&self, _id: TypeKindId) -> Identifier { | 282 | fn type_name(&self, _id: TypeKindId) -> Identifier { |
@@ -283,7 +286,7 @@ where | |||
283 | &self, | 286 | &self, |
284 | projection: &'p ProjectionTy, | 287 | projection: &'p ProjectionTy, |
285 | ) -> (Arc<AssociatedTyDatum>, &'p [Parameter], &'p [Parameter]) { | 288 | ) -> (Arc<AssociatedTyDatum>, &'p [Parameter], &'p [Parameter]) { |
286 | eprintln!("split_projection {:?}", projection); | 289 | debug!("split_projection {:?}", projection); |
287 | unimplemented!() | 290 | unimplemented!() |
288 | } | 291 | } |
289 | } | 292 | } |