Skip to content

Commit 7047979

Browse files
committed
Document that call expressions also represent ADT constructors.
This is a rather obscure part of the language.
1 parent bed9a85 commit 7047979

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

src/librustc/hir/mod.rs

+3-1
Original file line numberDiff line numberDiff line change
@@ -1054,7 +1054,9 @@ pub enum Expr_ {
10541054
/// A function call
10551055
///
10561056
/// The first field resolves to the function itself (usually an `ExprPath`),
1057-
/// and the second field is the list of arguments
1057+
/// and the second field is the list of arguments.
1058+
/// This also represents calling the constructor of
1059+
/// tuple-like ADTs such as tuple structs and enum variants.
10581060
ExprCall(P<Expr>, HirVec<Expr>),
10591061
/// A method call (`x.foo::<'static, Bar, Baz>(a, b, c, d)`)
10601062
///

src/libsyntax/ast.rs

+3-1
Original file line numberDiff line numberDiff line change
@@ -901,7 +901,9 @@ pub enum ExprKind {
901901
/// A function call
902902
///
903903
/// The first field resolves to the function itself,
904-
/// and the second field is the list of arguments
904+
/// and the second field is the list of arguments.
905+
/// This also represents calling the constructor of
906+
/// tuple-like ADTs such as tuple structs and enum variants.
905907
Call(P<Expr>, Vec<P<Expr>>),
906908
/// A method call (`x.foo::<'static, Bar, Baz>(a, b, c, d)`)
907909
///

0 commit comments

Comments
 (0)