Skip to content

Need proper tip for range syntax #21502

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
bombless opened this issue Jan 22, 2015 · 2 comments
Closed

Need proper tip for range syntax #21502

bombless opened this issue Jan 22, 2015 · 2 comments

Comments

@bombless
Copy link
Contributor

For

fn foo() {
    for i in 0 .. 9us {
        println!("{}", i)
    }
}

it compiles fine, and for

fn bar(len: usize) {
    for i in 0 .. len {
        println!("{}", i)
    }
}

compiler shows

3:10: 3:11 error: expected `:`, found `!`

It should give a tip that parentheses are missing anyway.

Rustc version:

rustc 1.0.0-dev (1028e185f 2015-01-20 18:12:41 +0800)
binary: rustc
commit-hash: 1028e185f91482551f629e97b8c3ad7ce0ade2f7
commit-date: 2015-01-20 18:12:41 +0800
host: i686-pc-windows-gnu
release: 1.0.0-dev
@klutzy
Copy link
Contributor

klutzy commented Jan 22, 2015

#20241?

@bombless
Copy link
Contributor Author

@klutzy Thanks!
Dup of #20241, so I'm closing it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants