diff options
Diffstat (limited to 'crates/ra_hir/src')
-rw-r--r-- | crates/ra_hir/src/ty/method_resolution.rs | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/crates/ra_hir/src/ty/method_resolution.rs b/crates/ra_hir/src/ty/method_resolution.rs index 9caff422f..8d682bb18 100644 --- a/crates/ra_hir/src/ty/method_resolution.rs +++ b/crates/ra_hir/src/ty/method_resolution.rs | |||
@@ -175,9 +175,15 @@ pub(crate) fn lookup_method( | |||
175 | }) | 175 | }) |
176 | } | 176 | } |
177 | 177 | ||
178 | /// Whether we're looking up a dotted method call (like `v.len()`) or a path | ||
179 | /// (like `Vec::new`). | ||
178 | #[derive(Copy, Clone, Debug, PartialEq, Eq)] | 180 | #[derive(Copy, Clone, Debug, PartialEq, Eq)] |
179 | pub enum LookupMode { | 181 | pub enum LookupMode { |
182 | /// Looking up a method call like `v.len()`: We only consider candidates | ||
183 | /// that have a `self` parameter, and do autoderef. | ||
180 | MethodCall, | 184 | MethodCall, |
185 | /// Looking up a path like `Vec::new` or `Vec::default`: We consider all | ||
186 | /// candidates including associated constants, but don't do autoderef. | ||
181 | Path, | 187 | Path, |
182 | } | 188 | } |
183 | 189 | ||