@@ -56,61 +56,27 @@ static WHITELIST_CRATES: &'static [CrateVersion] = &[
5656
5757/// Whitelist of crates rustc is allowed to depend on. Avoid adding to the list if possible.
5858static WHITELIST : & ' static [ Crate ] = & [
59- // Crate("ar"),
60- // Crate("arena"),
6159// Crate("backtrace"),
6260// Crate("backtrace-sys"),
6361// Crate("bitflags"),
64- // Crate("build_helper"),
6562// Crate("byteorder"),
6663// Crate("cc"),
6764// Crate("cfg-if"),
68- // Crate("cmake"),
69- // Crate("filetime"),
7065// Crate("flate2"),
71- // Crate("fmt_macros"),
7266// Crate("fuchsia-zircon"),
7367// Crate("fuchsia-zircon-sys"),
74- // Crate("graphviz"),
7568// Crate("jobserver"),
76- // Crate("kernel32-sys"),
7769// Crate("lazy_static"),
7870// Crate("libc"),
7971// Crate("log"),
80- // Crate("log_settings"),
8172// Crate("miniz-sys"),
8273// Crate("num_cpus"),
83- // Crate("owning_ref"),
84- // Crate("parking_lot"),
85- // Crate("parking_lot_core"),
8674// Crate("rand"),
87- // Crate("redox_syscall"),
8875// Crate("rustc"),
8976// Crate("rustc-demangle"),
90- // Crate("rustc_allocator"),
91- // Crate("rustc_apfloat"),
92- // Crate("rustc_back"),
93- // Crate("rustc_binaryen"),
94- // Crate("rustc_const_eval"),
95- // Crate("rustc_const_math"),
96- // Crate("rustc_cratesio_shim"),
97- // Crate("rustc_data_structures"),
98- // Crate("rustc_errors"),
99- // Crate("rustc_incremental"),
100- // Crate("rustc_llvm"),
101- // Crate("rustc_mir"),
102- // Crate("rustc_platform_intrinsics"),
10377// Crate("rustc_trans"),
104- // Crate("rustc_trans_utils"),
105- // Crate("serialize"),
106- // Crate("smallvec"),
107- // Crate("stable_deref_trait"),
108- // Crate("syntax"),
109- // Crate("syntax_pos"),
11078// Crate("tempdir"),
111- // Crate("unicode-width"),
11279// Crate("winapi"),
113- // Crate("winapi-build"),
11480// Crate("winapi-i686-pc-windows-gnu"),
11581// Crate("winapi-x86_64-pc-windows-gnu"),
11682] ;
@@ -147,12 +113,16 @@ impl<'a> Crate<'a> {
147113}
148114
149115impl < ' a > CrateVersion < ' a > {
150- pub fn from_str ( s : & ' a str ) -> Self {
116+ /// Returns the struct and whether or not the dep is in-tree
117+ pub fn from_str ( s : & ' a str ) -> ( Self , bool ) {
151118 let mut parts = s. split ( " " ) ;
152119 let name = parts. next ( ) . unwrap ( ) ;
153120 let version = parts. next ( ) . unwrap ( ) ;
121+ let path = parts. next ( ) . unwrap ( ) ;
154122
155- CrateVersion ( name, version)
123+ let is_path_dep = path. starts_with ( "(path+" ) ;
124+
125+ ( CrateVersion ( name, version) , is_path_dep)
156126 }
157127
158128 pub fn id_str ( & self ) -> String {
@@ -310,10 +280,13 @@ fn check_crate_whitelist<'a, 'b>(
310280 . expect ( "crate does not exist" ) ;
311281
312282 for dep in to_check. dependencies . iter ( ) {
313- let krate = CrateVersion :: from_str ( dep) ;
314- let mut bad = check_crate_whitelist ( whitelist, resolve, visited, krate) ;
283+ let ( krate, is_path_dep) = CrateVersion :: from_str ( dep) ;
315284
316- unapproved. append ( & mut bad) ;
285+ // We don't check in-tree deps
286+ if !is_path_dep {
287+ let mut bad = check_crate_whitelist ( whitelist, resolve, visited, krate) ;
288+ unapproved. append ( & mut bad) ;
289+ }
317290 }
318291
319292 unapproved
0 commit comments