@@ -178,6 +178,7 @@ pub struct Config {
178178 package_cache_lock : RefCell < Option < ( Option < FileLock > , usize ) > > ,
179179 /// Cached configuration parsed by Cargo
180180 http_config : LazyCell < CargoHttpConfig > ,
181+ future_incompat_config : LazyCell < CargoFutureIncompatConfig > ,
181182 net_config : LazyCell < CargoNetConfig > ,
182183 build_config : LazyCell < CargoBuildConfig > ,
183184 target_cfgs : LazyCell < Vec < ( String , TargetCfgConfig ) > > ,
@@ -275,6 +276,7 @@ impl Config {
275276 updated_sources : LazyCell :: new ( ) ,
276277 package_cache_lock : RefCell :: new ( None ) ,
277278 http_config : LazyCell :: new ( ) ,
279+ future_incompat_config : LazyCell :: new ( ) ,
278280 net_config : LazyCell :: new ( ) ,
279281 build_config : LazyCell :: new ( ) ,
280282 target_cfgs : LazyCell :: new ( ) ,
@@ -1436,6 +1438,11 @@ impl Config {
14361438 . try_borrow_with ( || self . get :: < CargoHttpConfig > ( "http" ) )
14371439 }
14381440
1441+ pub fn future_incompat_config ( & self ) -> CargoResult < & CargoFutureIncompatConfig > {
1442+ self . future_incompat_config
1443+ . try_borrow_with ( || self . get :: < CargoFutureIncompatConfig > ( "future-incompat-report" ) )
1444+ }
1445+
14391446 pub fn net_config ( & self ) -> CargoResult < & CargoNetConfig > {
14401447 self . net_config
14411448 . try_borrow_with ( || self . get :: < CargoNetConfig > ( "net" ) )
@@ -2034,6 +2041,37 @@ pub struct CargoHttpConfig {
20342041 pub ssl_version : Option < SslVersionConfig > ,
20352042}
20362043
2044+ #[ derive( Debug , Default , Deserialize , PartialEq ) ]
2045+ #[ serde( rename_all = "kebab-case" ) ]
2046+ pub struct CargoFutureIncompatConfig {
2047+ frequency : Option < CargoFutureIncompatFrequencyConfig > ,
2048+ }
2049+
2050+ #[ derive( Debug , Deserialize , PartialEq ) ]
2051+ #[ serde( rename_all = "kebab-case" ) ]
2052+ pub enum CargoFutureIncompatFrequencyConfig {
2053+ Always ,
2054+ Never ,
2055+ }
2056+
2057+ impl CargoFutureIncompatConfig {
2058+ pub fn should_display_message ( & self ) -> bool {
2059+ use CargoFutureIncompatFrequencyConfig :: * ;
2060+
2061+ let frequency = self . frequency . as_ref ( ) . unwrap_or ( & Always ) ;
2062+ match frequency {
2063+ Always => true ,
2064+ Never => false ,
2065+ }
2066+ }
2067+ }
2068+
2069+ impl Default for CargoFutureIncompatFrequencyConfig {
2070+ fn default ( ) -> Self {
2071+ Self :: Always
2072+ }
2073+ }
2074+
20372075/// Configuration for `ssl-version` in `http` section
20382076/// There are two ways to configure:
20392077///
0 commit comments