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

Errors inside macros use unreliable line/column references #1000

Closed
jdm opened this issue Oct 3, 2011 · 3 comments
Closed

Errors inside macros use unreliable line/column references #1000

jdm opened this issue Oct 3, 2011 · 3 comments
Labels
A-frontend Area: frontend (errors, parsing and HIR) A-syntaxext Area: Syntax extensions E-hard Call for participation: Hard difficulty. Experience needed to fix: A lot.

Comments

@jdm
Copy link
Contributor

jdm commented Oct 3, 2011

Example:

a2q2a.rs:5:41: 5:47 error: unresolved modulename: std
a2q2a.rs:5         log_err #fmt("usage: %s infile", args[0]);
                                                    ^~~~~~
@brson
Copy link
Contributor

brson commented Oct 3, 2011

I don't know what the right solution for this is in general. In this case, #fmt is doing a pretty good job of identifying where the problem is, it just doesn't result in a very helpful error. Here args[0] ends up more or less being wrapped in std::extfmt::conv_str(...), and we haven't declared that we're using crate std.

For this specific problem syntax extensions will probably need to declare which crates they depend on at runtime so the compiler can catch this.

@brson
Copy link
Contributor

brson commented Oct 3, 2011

And happy 1000th issue, Rust!

@brson
Copy link
Contributor

brson commented Jul 31, 2012

Extensions have changed a lot in the last 10 months. The original example is too vague to test against the current codebase, so I'm going to close this. I do believe expanded macros have better error reporting now.

@brson brson closed this as completed Jul 31, 2012
ZuseZ4 pushed a commit to EnzymeAD/rust that referenced this issue Mar 7, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-frontend Area: frontend (errors, parsing and HIR) A-syntaxext Area: Syntax extensions E-hard Call for participation: Hard difficulty. Experience needed to fix: A lot.
Projects
None yet
Development

No branches or pull requests

2 participants