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

Fix span on unknown macro variable error #6691

Closed
emberian opened this issue May 23, 2013 · 4 comments
Closed

Fix span on unknown macro variable error #6691

emberian opened this issue May 23, 2013 · 4 comments
Labels
A-diagnostics Area: Messages for errors, warnings, and lints A-syntaxext Area: Syntax extensions P-low Low priority

Comments

@emberian
Copy link
Member

In #6686 I added an error, but the span is incorrect. Ideally it would cover the use of the unknown variable and not the m in macro_rules!.

erickt | maybe the caller of lookup_cur_matched has the span you are looking for?
erickt | if so, you could pass it in and use that for your error message
@graydon
Copy link
Contributor

graydon commented Jul 25, 2013

Reproduced 2013-07-25. Relative of #7970 perhaps? Nominating for production ready.

For ease of future reproduction, here's the test. Note where the failure is pointing to, relative to where the actual error is (the use of $nonexistent):

macro_rules! e( //~ ERROR unknown macro variable `nonexistent`
    ($inp:ident) => (
        $nonexistent
    );
)

fn main() {
    e!(foo);
}

@catamorphism
Copy link
Contributor

Accepted for production-ready

@pnkfelix
Copy link
Member

P-low, not 1.0.

@steveklabnik
Copy link
Member

This seems to have been fixed:

hello.rs:3:21: 3:33 error: unknown macro variable `nonexistent`
hello.rs:3                     $nonexistent
                               ^~~~~~~~~~~~

flip1995 pushed a commit to flip1995/rust that referenced this issue Feb 11, 2021
flip1995 pushed a commit to flip1995/rust that referenced this issue Feb 11, 2021
lintcheck: add a cmdline option --crates-toml <TOML PATH> to override crate sources file to use.

Fixes rust-lang#6691

changelog: lintcheck: add --crates-toml  cmdline option to override default crates.toml file.
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 A-syntaxext Area: Syntax extensions P-low Low priority
Projects
None yet
Development

No branches or pull requests

5 participants