如何使货物保存分析? [英] How to make cargo to save-analysis?

查看:91
本文介绍了如何使货物保存分析?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何将货物运到save-analysis?我知道

How can I make cargo to save-analysis? I know that I can do this with rustc by calling

rustc -Zsave-snalysis <files...>

但是,我不知道cargo.而且我还想知道如何将它们读回rls_analysis数据结构.

But, I couldn't figure out for cargo. And also I like to know how I can read them back to rls_analysis data structures.

我尝试了 cargo rustc -Zsave-analysis ,但似乎没有工作.

I tried cargo rustc -Zsave-analysis, but it doesn't seem to work.

我还尝试了 export RUSTC_SAVE_ANALYSIS=api ,也没有工作.

I also tried export RUSTC_SAVE_ANALYSIS=api, no work too.

我想要做的是获取源代码中标记的类型的完全限定路径(例如::foo1::foo2::Foo3).如果还有其他解决方案,也请让我知道.

What I want to do is getting fully qualified path (e.g. ::foo1::foo2::Foo3) to the types notated in source code. If there's other solution, please let me know that too.

推荐答案


更新


Update

使用默认配置AnalysisHost不会加载已保存的分析数据.这是因为 CargoAnalysisLoader试图从非默认位置.

Saved analysis data won't be loaded with default configuration of AnalysisHost. It's because CargoAnalysisLoader tries to load data from non-default location.

要解决此问题,只需将save-analysis目录移动到正确的位置.

To workaround, just move save-analysis directory to proper location.

target/debug/deps/save-analysis
target/rls/debug/deps/save-analysis

  • 根据您的构建模式将debug替换为release.
    • Replace debug to release according to your build mode.
    • 这篇关于如何使货物保存分析?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆