about summary refs log tree commit diff
diff options
context:
space:
mode:
authorRalf Jung <post@ralfj.de>2019-11-04 10:16:16 +0100
committerRalf Jung <post@ralfj.de>2019-11-04 10:16:16 +0100
commit151e9890f4cf8ea714dd6a4760589b322dab567b (patch)
tree89968e8d4a76750a51c6f81b908d9071ca6ca0c3
parent65153710e1cc46a33b65f90cd92732bc9c77cee5 (diff)
downloadrust-151e9890f4cf8ea714dd6a4760589b322dab567b.tar.gz
rust-151e9890f4cf8ea714dd6a4760589b322dab567b.zip
also explain how to resolve MethodCall
-rw-r--r--src/librustc/hir/mod.rs7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/librustc/hir/mod.rs b/src/librustc/hir/mod.rs
index d28624907d7..cbbf808bece 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.
+    ///
+    /// [`qpath_res`]: ../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>),
@@ -1701,7 +1706,7 @@ pub enum ExprKind {
 ///
 /// To resolve the path to a `DefId`, call [`qpath_res`].
 ///
-/// [`qpath_res`]: ty/struct.TypeckTables.html#method.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`