Skip to content

Commit

Permalink
Rollup merge of rust-lang#32083 - nodakai:reference-scoped-enum-alias…
Browse files Browse the repository at this point in the history
…, r=nikomatsakis

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

Tentatively define the current behavior as the specification.

Cf. rust-lang#26264, rust-lang#28556, rust-lang#30936
  • Loading branch information
steveklabnik committed Mar 8, 2016
2 parents be506b2 + 790178f commit 86fb351
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/doc/reference.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 86fb351

Please sign in to comment.