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

Missing references to fields #26

Open
sanxiyn opened this issue Jun 30, 2015 · 3 comments
Open

Missing references to fields #26

sanxiyn opened this issue Jun 30, 2015 · 3 comments

Comments

@sanxiyn
Copy link

sanxiyn commented Jun 30, 2015

https://dxr.allizom.org/rust/search?q=+var-ref:rustc::middle::dataflow::DataFlowContext::gens seems to miss many references which can be found by searching self.gens in dataflow.rs.

@nrc
Copy link
Owner

nrc commented Jun 30, 2015

All the missing references are either in for loops or assert! macros, both of which are generated code. Unfortunately DXR can't handle generated code yet. It looks like once it can, this issue should be solved.

@sanxiyn
Copy link
Author

sanxiyn commented Jul 1, 2015

Thanks, that makes sense.

Trying Rust DXR demo, I could imagine it would be useful. On the other hand, missing all codes inside for loops makes it not useful, not yet. Where should I start (say, some rough place in the code) to help get that fixed? I am interested.

@nrc
Copy link
Owner

nrc commented Jul 1, 2015

Its a problem with the Rust compiler, rather than DXR. The fix is to move expansion of for loops and similar things out of libsyntax into rustc. That is harder than it sounds, unfortunately. It is on my radar for the next quarter though.

Alternatively, it could be fixed by being able to handle expanded code, we'll need this for macros anyway. This should be possible by modifying src/librustc_trans/save/dump_csv.rs to not skip generated code and to use the right part of the expansion stack (rather than the top span). This is also a pretty big change, but would be super useful. If you want to give this a go, I'd have a poke around that code to familiarise yourself, then ping me on irc and we can make a plan.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants