如何使货物保存分析? [英] How to make cargo to 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 使用默认配置 Saved analysis data won't be loaded with default configuration of 要解决此问题,只需将 To workaround, just move
AnalysisHost
不会加载已保存的分析数据.这是因为 CargoAnalysisLoader
试图从非默认位置.AnalysisHost
. It's because CargoAnalysisLoader
tries to load data from non-default location.save-analysis
目录移动到正确的位置.save-analysis
directory to proper location.target/debug/deps/save-analysis
target/rls/debug/deps/save-analysis
debug
替换为release
.
- Replace
debug
torelease
according to your build mode.
这篇关于如何使货物保存分析?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!