Skip to content

Fix documentation: aliases may not be used in loop constructs. #208

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions doc/rust.texi
Original file line number Diff line number Diff line change
Expand Up @@ -3157,7 +3157,7 @@ fn read_file_lines(&str path) -> vec[str] @{
note path;
vec[str] r;
file f = open_read(path);
for each (&str s in lines(f)) @{
for each (str s in lines(f)) @{
vec.append(r,s);
@}
ret r;
Expand Down Expand Up @@ -3258,19 +3258,19 @@ Example of 4 for loops, all identical:
@example
let vec[foo] v = vec(a, b, c);

for (&foo e in v.(0, _vec.len(v))) @{
for (foo e in v.(0, _vec.len(v))) @{
bar(e);
@}

for (&foo e in v.(0,)) @{
for (foo e in v.(0,)) @{
bar(e);
@}

for (&foo e in v.(,)) @{
for (foo e in v.(,)) @{
bar(e);
@}

for (&foo e in v) @{
for (foo e in v) @{
bar(e);
@}
@end example
Expand All @@ -3290,7 +3290,7 @@ Example of a foreach loop:
@example
let str txt;
let vec[str] lines;
for each (&str s in _str.split(txt, "\n")) @{
for each (str s in _str.split(txt, "\n")) @{
vec.push(lines, s);
@}
@end example
Expand Down