@@ -228,6 +228,7 @@ pub struct GlobalContext {
228
228
doc_extern_map : LazyCell < RustdocExternMap > ,
229
229
progress_config : ProgressConfig ,
230
230
env_config : LazyCell < EnvConfig > ,
231
+ patchtool_config : LazyCell < PatchtoolConfig > ,
231
232
/// This should be false if:
232
233
/// - this is an artifact of the rustc distribution process for "stable" or for "beta"
233
234
/// - this is an `#[test]` that does not opt in with `enable_nightly_features`
@@ -322,6 +323,7 @@ impl GlobalContext {
322
323
doc_extern_map : LazyCell :: new ( ) ,
323
324
progress_config : ProgressConfig :: default ( ) ,
324
325
env_config : LazyCell :: new ( ) ,
326
+ patchtool_config : LazyCell :: new ( ) ,
325
327
nightly_features_allowed : matches ! ( & * features:: channel( ) , "nightly" | "dev" ) ,
326
328
ws_roots : RefCell :: new ( HashMap :: new ( ) ) ,
327
329
global_cache_tracker : LazyCell :: new ( ) ,
@@ -1861,6 +1863,11 @@ impl GlobalContext {
1861
1863
Ok ( env_config)
1862
1864
}
1863
1865
1866
+ pub fn patchtool_config ( & self ) -> CargoResult < & PatchtoolConfig > {
1867
+ self . patchtool_config
1868
+ . try_borrow_with ( || self . get :: < PatchtoolConfig > ( "patchtool" ) )
1869
+ }
1870
+
1864
1871
/// This is used to validate the `term` table has valid syntax.
1865
1872
///
1866
1873
/// This is necessary because loading the term settings happens very
@@ -2732,6 +2739,12 @@ where
2732
2739
deserializer. deserialize_option ( ProgressVisitor )
2733
2740
}
2734
2741
2742
+ #[ derive( Debug , Default , Deserialize ) ]
2743
+ #[ serde( rename_all = "kebab-case" ) ]
2744
+ pub struct PatchtoolConfig {
2745
+ pub path : Option < PathAndArgs > ,
2746
+ }
2747
+
2735
2748
#[ derive( Debug ) ]
2736
2749
enum EnvConfigValueInner {
2737
2750
Simple ( String ) ,
0 commit comments