Skip to content

Commit 9bfb5cc

Browse files
authored
Rollup merge of rust-lang#66076 - RalfJung:qpath, r=davidtwco,oli-obk
HIR docs: mention how to resolve method paths
2 parents db341c1 + f2ed1e6 commit 9bfb5cc

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

src/librustc/hir/mod.rs

+9
Original file line numberDiff line numberDiff line change
@@ -1616,6 +1616,11 @@ pub enum ExprKind {
16161616
/// and the remaining elements are the rest of the arguments.
16171617
/// Thus, `x.foo::<Bar, Baz>(a, b, c, d)` is represented as
16181618
/// `ExprKind::MethodCall(PathSegment { foo, [Bar, Baz] }, [x, a, b, c, d])`.
1619+
///
1620+
/// To resolve the called method to a `DefId`, call [`type_dependent_def_id`] with
1621+
/// the `hir_id` of the `MethodCall` node itself.
1622+
///
1623+
/// [`type_dependent_def_id`]: ../ty/struct.TypeckTables.html#method.type_dependent_def_id
16191624
MethodCall(P<PathSegment>, Span, HirVec<Expr>),
16201625
/// A tuple (e.g., `(a, b, c, d)`).
16211626
Tup(HirVec<Expr>),
@@ -1698,6 +1703,10 @@ pub enum ExprKind {
16981703
}
16991704

17001705
/// Represents an optionally `Self`-qualified value/type path or associated extension.
1706+
///
1707+
/// To resolve the path to a `DefId`, call [`qpath_res`].
1708+
///
1709+
/// [`qpath_res`]: ../ty/struct.TypeckTables.html#method.qpath_res
17011710
#[derive(RustcEncodable, RustcDecodable, Debug, HashStable)]
17021711
pub enum QPath {
17031712
/// Path to a definition, optionally "fully-qualified" with a `Self`

0 commit comments

Comments
 (0)