Register and stability check #[no_link] crates.
This commit is contained in:
parent
a1d45d94b0
commit
dd0781ea25
9 changed files with 50 additions and 41 deletions
|
|
@ -65,6 +65,8 @@ pub struct CrateSource {
|
|||
|
||||
#[derive(RustcEncodable, RustcDecodable, Copy, Clone, Ord, PartialOrd, Eq, PartialEq, Debug)]
|
||||
pub enum DepKind {
|
||||
/// A dependency that is only used for its macros.
|
||||
MacrosOnly,
|
||||
/// A dependency that is always injected into the dependency list and so
|
||||
/// doesn't need to be linked to an rlib, e.g. the injected allocator.
|
||||
Implicit,
|
||||
|
|
|
|||
|
|
@ -124,6 +124,7 @@ fn calculate_type(sess: &session::Session,
|
|||
return v;
|
||||
}
|
||||
for cnum in sess.cstore.crates() {
|
||||
if sess.cstore.dep_kind(cnum) == DepKind::MacrosOnly { continue }
|
||||
let src = sess.cstore.used_crate_source(cnum);
|
||||
if src.rlib.is_some() { continue }
|
||||
sess.err(&format!("dependency `{}` not found in rlib format",
|
||||
|
|
@ -156,6 +157,7 @@ fn calculate_type(sess: &session::Session,
|
|||
// dependencies, ensuring there are no conflicts. The only valid case for a
|
||||
// dependency to be relied upon twice is for both cases to rely on a dylib.
|
||||
for cnum in sess.cstore.crates() {
|
||||
if sess.cstore.dep_kind(cnum) == DepKind::MacrosOnly { continue }
|
||||
let name = sess.cstore.crate_name(cnum);
|
||||
let src = sess.cstore.used_crate_source(cnum);
|
||||
if src.dylib.is_some() {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue