-
Notifications
You must be signed in to change notification settings - Fork 553
Open
Labels
A-custom-driverArea: custom driverArea: custom driverC-discussionCategory: discussionCategory: discussionE-hardDifficulty: might require advanced knowledgeDifficulty: might require advanced knowledgeI-terseIssue: info is very terseIssue: info is very terseT-compilerRelevant to compiler teamRelevant to compiler team
Description
https://github.com/rust-lang/rustc-dev-guide/blob/master/examples/rustc-driver-example.rs is a great example to get me started using rustc_interface
, but I am stuck on how to point this query towards a file that references another crate. I want to use rustc to analyze a multi-crate project and build up info across all crates in the project.
I have a repo based directly on rustc-driver-example
, showing my problem. See this example which attempts to produce HIR for a file which references another crate. It fails with:
thread 'rustc' panicked at 'called `Result::unwrap()` on an `Err` value: failed while formatting fluent string `metadata_cannot_find_crate`:
message was missing
', compiler/rustc_errors/src/emitter.rs:1402:84
However I can generate a HIR for a file that does not depend on other crates.
What do I need to add to the config to make it aware of other crates?
zjp-CN
Metadata
Metadata
Assignees
Labels
A-custom-driverArea: custom driverArea: custom driverC-discussionCategory: discussionCategory: discussionE-hardDifficulty: might require advanced knowledgeDifficulty: might require advanced knowledgeI-terseIssue: info is very terseIssue: info is very terseT-compilerRelevant to compiler teamRelevant to compiler team