mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-26 11:59:49 +00:00
Don't add --all-targets to runnables for no-std crates
This commit is contained in:
parent
7c81fff520
commit
bbd9e41606
6 changed files with 47 additions and 13 deletions
|
@ -531,6 +531,11 @@ impl Analysis {
|
|||
self.with_db(|db| db.crate_graph()[crate_id].edition)
|
||||
}
|
||||
|
||||
/// Returns true if this crate has `no_std` or `no_core` specified.
|
||||
pub fn is_crate_no_std(&self, crate_id: CrateId) -> Cancellable<bool> {
|
||||
self.with_db(|db| hir::db::DefDatabase::crate_def_map(db, crate_id).is_no_std())
|
||||
}
|
||||
|
||||
/// Returns the root file of the given crate.
|
||||
pub fn crate_root(&self, crate_id: CrateId) -> Cancellable<FileId> {
|
||||
self.with_db(|db| db.crate_graph()[crate_id].root_file_id)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue