Skip to content

Commit

Permalink
Document that call expressions also represent ADT constructors.
Browse files Browse the repository at this point in the history
This is a rather obscure part of the language.
  • Loading branch information
leoyvens committed Oct 27, 2017
1 parent bed9a85 commit 7047979
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 3 additions & 1 deletion src/librustc/hir/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<Expr>, HirVec<Expr>),
/// A method call (`x.foo::<'static, Bar, Baz>(a, b, c, d)`)
///
Expand Down
4 changes: 3 additions & 1 deletion src/libsyntax/ast.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<Expr>, Vec<P<Expr>>),
/// A method call (`x.foo::<'static, Bar, Baz>(a, b, c, d)`)
///
Expand Down

0 comments on commit 7047979

Please sign in to comment.