Skip to content
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

Poor error message when forgetting the bang in a macro. #25910

Closed
Ms2ger opened this issue May 30, 2015 · 4 comments
Closed

Poor error message when forgetting the bang in a macro. #25910

Ms2ger opened this issue May 30, 2015 · 4 comments
Labels
A-diagnostics Area: Messages for errors, warnings, and lints

Comments

@Ms2ger
Copy link
Contributor

Ms2ger commented May 30, 2015

fn main() {
    for i in 1..10 {
        println("{}", i);
    }
}

yields (on playpen):

<anon>:3:9: 3:16 error: unresolved name `println`. Did you mean `iter`?
<anon>:3         println("{}", i);
                 ^~~~~~~
error: aborting due to previous error
playpen: application terminated with error code 101

which is not helpful.

@sfackler sfackler added the A-diagnostics Area: Messages for errors, warnings, and lints label May 30, 2015
@nagisa
Copy link
Member

nagisa commented May 31, 2015

This is a bit towards E-hard, because macro expansion and name resolution happen in two different places and we do not retain much macro-related information by the time resolve happens. That is, you’d need to reconstruct a list of all macro names from scratch when an error happens to suggest something here.

@sfackler
Copy link
Member

sfackler commented Jun 1, 2015

Might be worth special casing println though, since it's so common. (Maybe try and vec as well?)

@Manishearth
Copy link
Member

#5780

@Manishearth
Copy link
Member

#29968

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-diagnostics Area: Messages for errors, warnings, and lints
Projects
None yet
Development

No branches or pull requests

4 participants