518dc52f85
This changes the indexing syntax from .() to [], the vector syntax from ~[] to [] and the extension syntax from #fmt() to #fmt[]
20 lines
288 B
Rust
20 lines
288 B
Rust
|
|
tag t { a; b(str); }
|
|
|
|
fn make(i: int) -> t {
|
|
if i > 10 { ret a; }
|
|
let s = "hello";
|
|
// Ensure s is non-const.
|
|
|
|
s += "there";
|
|
ret b(s);
|
|
}
|
|
|
|
fn main() {
|
|
let i = 0;
|
|
|
|
|
|
// The auto slot for the result of make(i) should not leak.
|
|
while make(i) != a { i += 1; }
|
|
}
|