Skip to content

Macros emitted by other macros aren't found #8120

@nox

Description

@nox
macro_rules! item {
    ($item:item) => { $item }
}

item! {
    macro_rules! indirect_macro { () => {} }
}

indirect_macro!(); // rust-analyzer sees an error here, because it doesn't know of indirect_macro.
{
	"resource": "/Users/nox/src/ra-bug/src/lib.rs",
	"owner": "rustc",
	"code": {
		"value": "unresolved-macro-call",
		"target": {
			"$mid": 1,
			"external": "https://rust-analyzer.github.io/manual.html#unresolved-macro-call",
			"path": "/manual.html",
			"scheme": "https",
			"authority": "rust-analyzer.github.io",
			"fragment": "unresolved-macro-call"
		}
	},
	"severity": 8,
	"message": "unresolved macro call",
	"source": "rust-analyzer",
	"startLineNumber": 9,
	"startColumn": 1,
	"endLineNumber": 9,
	"endColumn": 15
}

I don't think this was ever reported, so here we are.

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-macromacro expansionS-actionableSomeone could pick this issue up and work on it right now

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions