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

Incomplete save-analysis for macros #31553

Closed
DanielJCampbell opened this issue Feb 11, 2016 · 3 comments
Closed

Incomplete save-analysis for macros #31553

DanielJCampbell opened this issue Feb 11, 2016 · 3 comments
Labels
A-macros Area: All kinds of macros (custom derive, macro_rules!, proc macros, ..) A-save-analysis Area: saving results of analyses such as inference and borrowck results to a file. C-bug Category: This is a bug.

Comments

@DanielJCampbell
Copy link
Contributor

Currently macros are only recorded if they are called at some point in non-generated source code. The most notable effect of this is that if a macro references some other macro internally (eg. foo! expands to bar!), that macro will not be indexed.

A fix probably requires changes to expansion traces, to store more information about macro bodies after expansion, or manually pulling nested macro calls out of callee spans.

@steveklabnik steveklabnik added the A-macros Area: All kinds of macros (custom derive, macro_rules!, proc macros, ..) label Feb 15, 2016
@Mark-Simulacrum
Copy link
Member

Test case for future visits:

macro_rules! a {
    () => {
        macro_rules! b {
            () => {
                0
            };
        }
        b!()
    }
}

fn main() {
    a!();
}
rustc -Z save-analysis test.rs
rg '"name":"b"' save-analysis-temp/test.json # should find "b"

@Mark-Simulacrum Mark-Simulacrum added the C-bug Category: This is a bug. label Jul 24, 2017
@steveklabnik
Copy link
Member

Triage: no change

@jyn514 jyn514 added the A-save-analysis Area: saving results of analyses such as inference and borrowck results to a file. label Feb 19, 2023
@jyn514
Copy link
Member

jyn514 commented Feb 19, 2023

Save-analysis has been removed from the compiler.

@jyn514 jyn514 closed this as not planned Won't fix, can't repro, duplicate, stale Feb 19, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-macros Area: All kinds of macros (custom derive, macro_rules!, proc macros, ..) A-save-analysis Area: saving results of analyses such as inference and borrowck results to a file. C-bug Category: This is a bug.
Projects
None yet
Development

No branches or pull requests

4 participants