Skip to content

Incorrect Compiler Error #15362

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
Kleptine opened this issue Jul 3, 2014 · 1 comment
Closed

Incorrect Compiler Error #15362

Kleptine opened this issue Jul 3, 2014 · 1 comment

Comments

@Kleptine
Copy link

Kleptine commented Jul 3, 2014

When running the following (clearly broken) program, the compiler spits out a completely incorrect error message:

fn main() { 
    println!(format!("foo"))
}

Results:

<anon>:2:14: 2:20 error: macro undefined: 'format'
<anon>:2     println!(format!("foo"))
                      ^~~~~~
<anon>:2:14: 2:28 error: format argument must be a string literal.
<anon>:2     println!(format!("foo"))
                      ^~~~~~~~~~~~~~
error: aborting due to 2 previous errors
playpen: application terminated with error code 101

http://is.gd/XYH1f2

While the second is correct, the first is wrong, confusing and suggests that format! needs to be imported somehow.

@huonw
Copy link
Member

huonw commented Jul 3, 2014

Dupe of #12404

(Thanks for filing!)

@huonw huonw closed this as completed Jul 3, 2014
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