@@ -62,6 +62,7 @@ use cargo_util::ProcessBuilder;
62
62
use crossbeam_utils:: thread:: Scope ;
63
63
use jobserver:: { Acquired , Client , HelperThread } ;
64
64
use log:: { debug, info, trace} ;
65
+ use semver:: Version ;
65
66
66
67
use super :: context:: OutputFile ;
67
68
use super :: job:: {
@@ -74,9 +75,8 @@ use crate::core::compiler::future_incompat::{
74
75
FutureBreakageItem , FutureIncompatReportPackage , OnDiskReports ,
75
76
} ;
76
77
use crate :: core:: resolver:: ResolveBehavior ;
77
- use crate :: core:: { FeatureValue , PackageId , Shell , TargetKind } ;
78
+ use crate :: core:: { PackageId , Shell , TargetKind } ;
78
79
use crate :: util:: diagnostic_server:: { self , DiagnosticPrinter } ;
79
- use crate :: util:: interning:: InternedString ;
80
80
use crate :: util:: machine_message:: { self , Message as _} ;
81
81
use crate :: util:: CargoResult ;
82
82
use crate :: util:: { self , internal, profile} ;
@@ -1249,55 +1249,27 @@ impl<'cfg> DrainState<'cfg> {
1249
1249
1250
1250
fn back_compat_notice ( & self , cx : & Context < ' _ , ' _ > , unit : & Unit ) -> CargoResult < ( ) > {
1251
1251
if unit. pkg . name ( ) != "diesel"
1252
- || unit. pkg . version ( ) . major != 1
1252
+ || unit. pkg . version ( ) >= & Version :: new ( 1 , 4 , 8 )
1253
1253
|| cx. bcx . ws . resolve_behavior ( ) == ResolveBehavior :: V1
1254
1254
|| !unit. pkg . package_id ( ) . source_id ( ) . is_registry ( )
1255
1255
|| !unit. features . is_empty ( )
1256
1256
{
1257
1257
return Ok ( ( ) ) ;
1258
1258
}
1259
- let other_diesel = match cx
1259
+ if ! cx
1260
1260
. bcx
1261
1261
. unit_graph
1262
1262
. keys ( )
1263
- . find ( |unit| unit. pkg . name ( ) == "diesel" && !unit. features . is_empty ( ) )
1263
+ . any ( |unit| unit. pkg . name ( ) == "diesel" && !unit. features . is_empty ( ) )
1264
1264
{
1265
- Some ( u) => u,
1266
- // Unlikely due to features.
1267
- None => return Ok ( ( ) ) ,
1268
- } ;
1269
- let mut features_suggestion: BTreeSet < _ > = other_diesel. features . iter ( ) . collect ( ) ;
1270
- let fmap = other_diesel. pkg . summary ( ) . features ( ) ;
1271
- // Remove any unnecessary features.
1272
- for feature in & other_diesel. features {
1273
- if let Some ( feats) = fmap. get ( feature) {
1274
- for feat in feats {
1275
- if let FeatureValue :: Feature ( f) = feat {
1276
- features_suggestion. remove ( & f) ;
1277
- }
1278
- }
1279
- }
1265
+ return Ok ( ( ) ) ;
1280
1266
}
1281
- features_suggestion. remove ( & InternedString :: new ( "default" ) ) ;
1282
- let features_suggestion = toml:: to_string ( & features_suggestion) . unwrap ( ) ;
1283
-
1284
- cx. bcx . config . shell ( ) . note ( & format ! (
1267
+ cx. bcx . config . shell ( ) . note (
1285
1268
"\
1286
1269
This error may be due to an interaction between diesel and Cargo's new
1287
- feature resolver. Some workarounds you may want to consider:
1288
- - Add a build-dependency in Cargo.toml on diesel to force Cargo to add the appropriate
1289
- features. This may look something like this:
1290
-
1291
- [build-dependencies]
1292
- diesel = {{ version = \" {}\" , features = {} }}
1293
-
1294
- - Try using the previous resolver by setting `resolver = \" 1\" ` in `Cargo.toml`
1295
- (see <https://doc.rust-lang.org/cargo/reference/resolver.html#resolver-versions>
1296
- for more information).
1270
+ feature resolver. Try updating to diesel 1.4.8 to fix this error.
1297
1271
" ,
1298
- unit. pkg. version( ) ,
1299
- features_suggestion
1300
- ) ) ?;
1272
+ ) ?;
1301
1273
Ok ( ( ) )
1302
1274
}
1303
1275
}
0 commit comments