Skip to content

Commit 6d54054

Browse files
committed
fix out of date info on type aliases
1 parent 5d40ba5 commit 6d54054

File tree

1 file changed

+10
-5
lines changed

1 file changed

+10
-5
lines changed

src/items/type-aliases.md

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,13 +20,18 @@ type Point = (u8, u8);
2020
let p: Point = (41, 68);
2121
```
2222

23-
A type alias to an enum type cannot be used to qualify the constructors:
23+
A type alias to an tuple-struct type cannot be used to qualify the constructors:
2424

2525
```rust
26-
enum E { A }
27-
type F = E;
28-
let _: F = E::A; // OK
29-
// let _: F = F::A; // Doesn't work
26+
pub struct MyStruct(u32);
27+
28+
pub use self::MyStruct as PubUse;
29+
pub type PubType = MyStruct;
30+
31+
fn main() {
32+
let _ = PubUse(5); // OK
33+
// let _ = PubType(5); // Doesn't work
34+
}
3035
```
3136

3237
[IDENTIFIER]: ../identifiers.md

0 commit comments

Comments
 (0)