From dc4066ebed57d43068035f574244e3abd18ee67f Mon Sep 17 00:00:00 2001 From: Florian Diebold Date: Fri, 1 Nov 2019 11:53:29 +0100 Subject: Add some doc comments --- crates/ra_hir/src/ty/method_resolution.rs | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'crates') 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( }) } +/// Whether we're looking up a dotted method call (like `v.len()`) or a path +/// (like `Vec::new`). #[derive(Copy, Clone, Debug, PartialEq, Eq)] pub enum LookupMode { + /// Looking up a method call like `v.len()`: We only consider candidates + /// that have a `self` parameter, and do autoderef. MethodCall, + /// Looking up a path like `Vec::new` or `Vec::default`: We consider all + /// candidates including associated constants, but don't do autoderef. Path, } -- cgit v1.2.3