Skip to content

Commit ffa95d7

Browse files
committed
---
yaml --- r: 2317 b: refs/heads/master c: 3014a58 h: refs/heads/master i: 2315: db9f77c v: v3
1 parent 97d334d commit ffa95d7

File tree

4 files changed

+49
-1
lines changed

4 files changed

+49
-1
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
---
2-
refs/heads/master: cb53065a2116067a036993a6762259a66c4abfac
2+
refs/heads/master: 3014a5887d4785285a3f42e19f2de24e141e3eb8
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
// xfail-boot
2+
// error-pattern: unresolved name
3+
4+
// Tag variants are not exported with their tags. This allows for a
5+
// simple sort of ADT.
6+
7+
mod foo {
8+
export t;
9+
10+
tag t {
11+
t1;
12+
}
13+
}
14+
15+
fn main() {
16+
auto x = foo.t1;
17+
}
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
// We can export tags without exporting the variants to create a simple
2+
// sort of ADT.
3+
4+
mod foo {
5+
export t;
6+
export f;
7+
8+
tag t {
9+
t1;
10+
}
11+
12+
fn f() -> t {
13+
ret t1;
14+
}
15+
}
16+
17+
fn main() {
18+
let foo.t v = foo.f();
19+
}
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
// Export the tag variants, without the tag
2+
3+
mod foo {
4+
export t1;
5+
tag t {
6+
t1;
7+
}
8+
}
9+
10+
fn main() {
11+
auto v = foo.t1;
12+
}

0 commit comments

Comments
 (0)