@@ -23,12 +23,9 @@ StructExprField ->
2323
2424StructBase -> `..` Expression
2525
26- StructExprTuple ->
27- PathInExpression `(`
28- ( Expression (`,` Expression)* `,`? )?
29- `)`
26+ StructExprTuple -> CallExpression
3027
31- StructExprUnit -> PathInExpression
28+ StructExprUnit -> PathExpression
3229```
3330
3431r[ expr.struct.intro]
@@ -129,6 +126,20 @@ let c = Position; // `c` is a function that takes 3 arguments.
129126let pos = c (8 , 6 , 7 ); // Creates a `Position` value.
130127```
131128
129+ > [ !NOTE]
130+ > While the grammar permits qualified paths, the last segment can't be a type alias:
131+ >
132+ > ``` rust
133+ > trait Tr { type T ; }
134+ > impl <T > Tr for T { type T = T ; }
135+ >
136+ > struct Tuple ();
137+ > enum Enum { Tuple () }
138+ >
139+ > // <Unit as Tr>::T(); // causes an error -- `::T` is a type, not a value
140+ > <Enum as Tr >:: T :: Tuple (); // OK
141+ > ```
142+
132143r [expr . struct . unit]
133144## Unit struct expression
134145
@@ -142,6 +153,20 @@ let a = Gamma; // Gamma unit value.
142153let b = Gamma {}; // Exact same value as `a`.
143154```
144155
156+ > [ !NOTE]
157+ > While the grammar permits qualified paths, the last segment can't be a type alias:
158+ >
159+ > ``` rust
160+ > trait Tr { type T ; }
161+ > impl <T > Tr for T { type T = T ; }
162+ >
163+ > struct Unit ;
164+ > enum Enum { Unit }
165+ >
166+ > // <Unit as Tr>::T; // causes an error -- `::T` is a type, not a value
167+ > <Enum as Tr >:: T :: Unit ; // OK
168+ > ```
169+
145170[call expression ]: call - expr . md
146171[enum variant ]: .. / items / enumerations . md
147172[if let ]: if - expr . md#if - let - expressions
0 commit comments