Rollup merge of #32083 - nodakai:reference-scoped-enum-alias, r=nikomatsakis

reference.md: clarify the limitation of type alias on an enum

Tentatively define the current behavior as the specification.

Cf. rust-lang/rust#26264, rust-lang/rust#28556, rust-lang/rust#30936
This commit is contained in:
Steve Klabnik 2016-03-08 21:44:11 +03:00
commit 86fb351059

View File

@ -1118,6 +1118,16 @@ type Point = (u8, u8);
let p: Point = (41, 68);
```
Currently a type alias to an enum type cannot be used to qualify the
constructors:
```
enum E { A }
type F = E;
let _: F = E::A; // OK
// let _: F = F::A; // Doesn't work
```
### Structs
A _struct_ is a nominal [struct type](#struct-types) defined with the