diff options
Diffstat (limited to 'crates/ide_db')
-rw-r--r-- | crates/ide_db/src/apply_change.rs | 1 | ||||
-rw-r--r-- | crates/ide_db/src/helpers.rs | 4 | ||||
-rw-r--r-- | crates/ide_db/src/helpers/famous_defs_fixture.rs | 6 | ||||
-rw-r--r-- | crates/ide_db/src/helpers/import_assets.rs | 2 |
4 files changed, 11 insertions, 2 deletions
diff --git a/crates/ide_db/src/apply_change.rs b/crates/ide_db/src/apply_change.rs index 047a9b6bc..111e9325a 100644 --- a/crates/ide_db/src/apply_change.rs +++ b/crates/ide_db/src/apply_change.rs | |||
@@ -101,6 +101,7 @@ impl RootDatabase { | |||
101 | // | 101 | // |
102 | // | VS Code | **Rust Analyzer: Memory Usage (Clears Database)** | 102 | // | VS Code | **Rust Analyzer: Memory Usage (Clears Database)** |
103 | // |=== | 103 | // |=== |
104 | // image::https://user-images.githubusercontent.com/48062697/113065592-08559f00-91b1-11eb-8c96-64b88068ec02.gif[] | ||
104 | pub fn per_query_memory_usage(&mut self) -> Vec<(String, Bytes)> { | 105 | pub fn per_query_memory_usage(&mut self) -> Vec<(String, Bytes)> { |
105 | let mut acc: Vec<(String, Bytes)> = vec![]; | 106 | let mut acc: Vec<(String, Bytes)> = vec![]; |
106 | let sweep = SweepStrategy::default().discard_values().sweep_all_revisions(); | 107 | let sweep = SweepStrategy::default().discard_values().sweep_all_revisions(); |
diff --git a/crates/ide_db/src/helpers.rs b/crates/ide_db/src/helpers.rs index 9992a92bd..66798ea3a 100644 --- a/crates/ide_db/src/helpers.rs +++ b/crates/ide_db/src/helpers.rs | |||
@@ -93,6 +93,10 @@ impl FamousDefs<'_, '_> { | |||
93 | self.find_trait("core:convert:From") | 93 | self.find_trait("core:convert:From") |
94 | } | 94 | } |
95 | 95 | ||
96 | pub fn core_convert_Into(&self) -> Option<Trait> { | ||
97 | self.find_trait("core:convert:Into") | ||
98 | } | ||
99 | |||
96 | pub fn core_option_Option(&self) -> Option<Enum> { | 100 | pub fn core_option_Option(&self) -> Option<Enum> { |
97 | self.find_enum("core:option:Option") | 101 | self.find_enum("core:option:Option") |
98 | } | 102 | } |
diff --git a/crates/ide_db/src/helpers/famous_defs_fixture.rs b/crates/ide_db/src/helpers/famous_defs_fixture.rs index d3464ae17..4d79e064e 100644 --- a/crates/ide_db/src/helpers/famous_defs_fixture.rs +++ b/crates/ide_db/src/helpers/famous_defs_fixture.rs | |||
@@ -14,6 +14,10 @@ pub mod convert { | |||
14 | pub trait From<T> { | 14 | pub trait From<T> { |
15 | fn from(t: T) -> Self; | 15 | fn from(t: T) -> Self; |
16 | } | 16 | } |
17 | |||
18 | pub trait Into<T> { | ||
19 | pub fn into(self) -> T; | ||
20 | } | ||
17 | } | 21 | } |
18 | 22 | ||
19 | pub mod default { | 23 | pub mod default { |
@@ -120,7 +124,7 @@ pub mod option { | |||
120 | pub mod prelude { | 124 | pub mod prelude { |
121 | pub use crate::{ | 125 | pub use crate::{ |
122 | cmp::Ord, | 126 | cmp::Ord, |
123 | convert::From, | 127 | convert::{From, Into}, |
124 | default::Default, | 128 | default::Default, |
125 | iter::{IntoIterator, Iterator}, | 129 | iter::{IntoIterator, Iterator}, |
126 | ops::{Fn, FnMut, FnOnce}, | 130 | ops::{Fn, FnMut, FnOnce}, |
diff --git a/crates/ide_db/src/helpers/import_assets.rs b/crates/ide_db/src/helpers/import_assets.rs index 3deb0d159..8ce648367 100644 --- a/crates/ide_db/src/helpers/import_assets.rs +++ b/crates/ide_db/src/helpers/import_assets.rs | |||
@@ -361,7 +361,7 @@ fn item_for_path_search(db: &RootDatabase, item: ItemInNs) -> Option<ItemInNs> { | |||
361 | Some(assoc_item) => match assoc_item.container(db) { | 361 | Some(assoc_item) => match assoc_item.container(db) { |
362 | AssocItemContainer::Trait(trait_) => ItemInNs::from(ModuleDef::from(trait_)), | 362 | AssocItemContainer::Trait(trait_) => ItemInNs::from(ModuleDef::from(trait_)), |
363 | AssocItemContainer::Impl(impl_) => { | 363 | AssocItemContainer::Impl(impl_) => { |
364 | ItemInNs::from(ModuleDef::from(impl_.target_ty(db).as_adt()?)) | 364 | ItemInNs::from(ModuleDef::from(impl_.self_ty(db).as_adt()?)) |
365 | } | 365 | } |
366 | }, | 366 | }, |
367 | None => item, | 367 | None => item, |