@@ -56,61 +56,27 @@ static WHITELIST_CRATES: &'static [CrateVersion] = &[
56
56
57
57
/// Whitelist of crates rustc is allowed to depend on. Avoid adding to the list if possible.
58
58
static WHITELIST : & ' static [ Crate ] = & [
59
- // Crate("ar"),
60
- // Crate("arena"),
61
59
// Crate("backtrace"),
62
60
// Crate("backtrace-sys"),
63
61
// Crate("bitflags"),
64
- // Crate("build_helper"),
65
62
// Crate("byteorder"),
66
63
// Crate("cc"),
67
64
// Crate("cfg-if"),
68
- // Crate("cmake"),
69
- // Crate("filetime"),
70
65
// Crate("flate2"),
71
- // Crate("fmt_macros"),
72
66
// Crate("fuchsia-zircon"),
73
67
// Crate("fuchsia-zircon-sys"),
74
- // Crate("graphviz"),
75
68
// Crate("jobserver"),
76
- // Crate("kernel32-sys"),
77
69
// Crate("lazy_static"),
78
70
// Crate("libc"),
79
71
// Crate("log"),
80
- // Crate("log_settings"),
81
72
// Crate("miniz-sys"),
82
73
// Crate("num_cpus"),
83
- // Crate("owning_ref"),
84
- // Crate("parking_lot"),
85
- // Crate("parking_lot_core"),
86
74
// Crate("rand"),
87
- // Crate("redox_syscall"),
88
75
// Crate("rustc"),
89
76
// 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"),
103
77
// 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"),
110
78
// Crate("tempdir"),
111
- // Crate("unicode-width"),
112
79
// Crate("winapi"),
113
- // Crate("winapi-build"),
114
80
// Crate("winapi-i686-pc-windows-gnu"),
115
81
// Crate("winapi-x86_64-pc-windows-gnu"),
116
82
] ;
@@ -147,12 +113,16 @@ impl<'a> Crate<'a> {
147
113
}
148
114
149
115
impl < ' 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 ) {
151
118
let mut parts = s. split ( " " ) ;
152
119
let name = parts. next ( ) . unwrap ( ) ;
153
120
let version = parts. next ( ) . unwrap ( ) ;
121
+ let path = parts. next ( ) . unwrap ( ) ;
154
122
155
- CrateVersion ( name, version)
123
+ let is_path_dep = path. starts_with ( "(path+" ) ;
124
+
125
+ ( CrateVersion ( name, version) , is_path_dep)
156
126
}
157
127
158
128
pub fn id_str ( & self ) -> String {
@@ -310,10 +280,13 @@ fn check_crate_whitelist<'a, 'b>(
310
280
. expect ( "crate does not exist" ) ;
311
281
312
282
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) ;
315
284
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
+ }
317
290
}
318
291
319
292
unapproved
0 commit comments