about summary refs log tree commit diff
diff options
context:
space:
mode:
authorYuki Okushi <huyuumi.dev@gmail.com>2019-11-07 09:20:38 +0900
committerGitHub <noreply@github.com>2019-11-07 09:20:38 +0900
commita30964e6c0360a76f8f45d537fa4518115f02674 (patch)
tree9d97e81c4c4fe90e91cac262050380c23908068f
parent12ffe5ffdd51d0f4c860d064d7e70912cbbf3863 (diff)
parentf2ed1e661e69dc463aa18ef3912501e1dde936b8 (diff)
Rollup merge of #66076 - RalfJung:qpath, r=davidtwco,oli-obk
HIR docs: mention how to resolve method paths
-rw-r--r--src/librustc/hir/mod.rs9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/librustc/hir/mod.rs b/src/librustc/hir/mod.rs
index 0edc41e6b48..d6f7ba6b973 100644
--- a/src/librustc/hir/mod.rs
+++ b/src/librustc/hir/mod.rs
@@ -1616,6 +1616,11 @@ pub enum ExprKind {
     /// and the remaining elements are the rest of the arguments.
     /// Thus, `x.foo::<Bar, Baz>(a, b, c, d)` is represented as
     /// `ExprKind::MethodCall(PathSegment { foo, [Bar, Baz] }, [x, a, b, c, d])`.
+    ///
+    /// To resolve the called method to a `DefId`, call [`type_dependent_def_id`] with
+    /// the `hir_id` of the `MethodCall` node itself.
+    ///
+    /// [`type_dependent_def_id`]: ../ty/struct.TypeckTables.html#method.type_dependent_def_id
     MethodCall(P<PathSegment>, Span, HirVec<Expr>),
     /// A tuple (e.g., `(a, b, c, d)`).
     Tup(HirVec<Expr>),
@@ -1698,6 +1703,10 @@ pub enum ExprKind {
 }
 
 /// Represents an optionally `Self`-qualified value/type path or associated extension.
+///
+/// To resolve the path to a `DefId`, call [`qpath_res`].
+///
+/// [`qpath_res`]: ../ty/struct.TypeckTables.html#method.qpath_res
 #[derive(RustcEncodable, RustcDecodable, Debug, HashStable)]
 pub enum QPath {
     /// Path to a definition, optionally "fully-qualified" with a `Self`