about summary refs log tree commit diff
path: root/src/doc/reference.md
diff options
context:
space:
mode:
authorSteve Klabnik <steve@steveklabnik.com>2016-03-08 21:44:11 +0300
committerSteve Klabnik <steve@steveklabnik.com>2016-03-08 21:44:11 +0300
commit86fb3510595ca8d61d6ea6fc2ddd0fbf9ab4d4e1 (patch)
tree06f55a911f0784acfa04fd8f5b0850c09cca7b15 /src/doc/reference.md
parentbe506b256f29d3a58d606c2092e20920ec469355 (diff)
parent790178f6e5e63265f9b59ed5748aa4de924e38e5 (diff)
downloadrust-86fb3510595ca8d61d6ea6fc2ddd0fbf9ab4d4e1.tar.gz
rust-86fb3510595ca8d61d6ea6fc2ddd0fbf9ab4d4e1.zip
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
Diffstat (limited to 'src/doc/reference.md')
-rw-r--r--src/doc/reference.md10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/doc/reference.md b/src/doc/reference.md
index 7022c9b72cf..8e655ee22e3 100644
--- a/src/doc/reference.md
+++ b/src/doc/reference.md
@@ -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