From 70479793ac9d7870d75d9c33f2776e95cff31d84 Mon Sep 17 00:00:00 2001 From: "leonardo.yvens" Date: Fri, 27 Oct 2017 16:27:59 -0200 Subject: [PATCH] Document that call expressions also represent ADT constructors. This is a rather obscure part of the language. --- src/librustc/hir/mod.rs | 4 +++- src/libsyntax/ast.rs | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/librustc/hir/mod.rs b/src/librustc/hir/mod.rs index fb3fc8a2da4f3..c6508598c19fe 100644 --- a/src/librustc/hir/mod.rs +++ b/src/librustc/hir/mod.rs @@ -1054,7 +1054,9 @@ pub enum Expr_ { /// A function call /// /// The first field resolves to the function itself (usually an `ExprPath`), - /// and the second field is the list of arguments + /// and the second field is the list of arguments. + /// This also represents calling the constructor of + /// tuple-like ADTs such as tuple structs and enum variants. ExprCall(P, HirVec), /// A method call (`x.foo::<'static, Bar, Baz>(a, b, c, d)`) /// diff --git a/src/libsyntax/ast.rs b/src/libsyntax/ast.rs index 090fc193b38a9..52b50a81e79fb 100644 --- a/src/libsyntax/ast.rs +++ b/src/libsyntax/ast.rs @@ -901,7 +901,9 @@ pub enum ExprKind { /// A function call /// /// The first field resolves to the function itself, - /// and the second field is the list of arguments + /// and the second field is the list of arguments. + /// This also represents calling the constructor of + /// tuple-like ADTs such as tuple structs and enum variants. Call(P, Vec>), /// A method call (`x.foo::<'static, Bar, Baz>(a, b, c, d)`) ///