Skip to content

Commit

Permalink
Rollup merge of rust-lang#45579 - leodasvacas:document-that-call-can-…
Browse files Browse the repository at this point in the history
…be-adt-constructor, r=estebank

Document that call expressions also represent ADT constructors.

This is a rather obscure part of the language.
  • Loading branch information
kennytm authored Nov 1, 2017
2 parents 07df45d + 7047979 commit 59c9d03
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 59c9d03

Please sign in to comment.