@@ -97,9 +97,21 @@ struct StepDescription {
97
97
name : & ' static str ,
98
98
}
99
99
100
+ /// Collection of paths used to match a task rule.
100
101
#[ derive( Debug , Clone , PartialOrd , Ord , PartialEq , Eq ) ]
101
102
pub enum PathSet {
103
+ /// A collection of individual paths.
104
+ ///
105
+ /// These are generally matched as a path suffix. For example, a
106
+ /// command-line value of `libstd` will match if `src/libstd` is in the
107
+ /// set.
102
108
Set ( BTreeSet < PathBuf > ) ,
109
+ /// A "suite" of paths.
110
+ ///
111
+ /// These can match as a path suffix (like `Set`), or as a prefix. For
112
+ /// example, a command-line value of `src/test/ui/abi/variadic-ffi.rs`
113
+ /// will match `src/test/ui`. A command-line value of `ui` would also
114
+ /// match `src/test/ui`.
103
115
Suite ( PathBuf ) ,
104
116
}
105
117
@@ -249,9 +261,15 @@ impl<'a> ShouldRun<'a> {
249
261
self
250
262
}
251
263
252
- // Unlike `krate` this will create just one pathset. As such, it probably shouldn't actually
253
- // ever be used, but as we transition to having all rules properly handle passing krate(...) by
254
- // actually doing something different for every crate passed.
264
+ /// Indicates it should run if the command-line selects the given crate or
265
+ /// any of its (local) dependencies.
266
+ ///
267
+ /// Compared to `krate`, this treats the dependencies as aliases for the
268
+ /// same job. Generally it is preferred to use `krate`, and treat each
269
+ /// individual path separately. For example `./x.py test src/liballoc`
270
+ /// (which uses `krate`) will test just `liballoc`. However, `./x.py check
271
+ /// src/liballoc` (which uses `all_krates`) will check all of `libtest`.
272
+ /// `all_krates` should probably be removed at some point.
255
273
pub fn all_krates ( mut self , name : & str ) -> Self {
256
274
let mut set = BTreeSet :: new ( ) ;
257
275
for krate in self . builder . in_tree_crates ( name) {
@@ -262,6 +280,10 @@ impl<'a> ShouldRun<'a> {
262
280
self
263
281
}
264
282
283
+ /// Indicates it should run if the command-line selects the given crate or
284
+ /// any of its (local) dependencies.
285
+ ///
286
+ /// `make_run` will be called separately for each matching command-line path.
265
287
pub fn krate ( mut self , name : & str ) -> Self {
266
288
for krate in self . builder . in_tree_crates ( name) {
267
289
let path = krate. local_path ( self . builder ) ;
0 commit comments