@@ -6,7 +6,7 @@ use serde::Deserialize;
66
77use  crate :: core:: compiler:: { CompileMode ,  ProfileKind } ; 
88use  crate :: core:: interning:: InternedString ; 
9- use  crate :: core:: { Feature ,  Features ,  PackageId ,  PackageIdSpec ,  PackageSet ,  Shell } ; 
9+ use  crate :: core:: { Feature ,  Features ,  PackageId ,  PackageIdSpec ,  Resolve ,  Shell } ; 
1010use  crate :: util:: errors:: CargoResultExt ; 
1111use  crate :: util:: toml:: { ProfilePackageSpec ,  StringOrBool ,  TomlProfile ,  TomlProfiles ,  U32OrBool } ; 
1212use  crate :: util:: { closest_msg,  CargoResult ,  Config } ; 
@@ -429,13 +429,9 @@ impl Profiles {
429429    } 
430430
431431    /// Used to check for overrides for non-existing packages. 
432- pub  fn  validate_packages ( 
433-         & self , 
434-         shell :  & mut  Shell , 
435-         packages :  & PackageSet < ' _ > , 
436-     )  -> CargoResult < ( ) >  { 
432+ pub  fn  validate_packages ( & self ,  shell :  & mut  Shell ,  resolve :  & Resolve )  -> CargoResult < ( ) >  { 
437433        for  profile in  self . by_name . values ( )  { 
438-             profile. validate_packages ( shell,  packages ) ?; 
434+             profile. validate_packages ( shell,  resolve ) ?; 
439435        } 
440436        Ok ( ( ) ) 
441437    } 
@@ -502,16 +498,16 @@ impl ProfileMaker {
502498        profile
503499    } 
504500
505-     fn  validate_packages ( & self ,  shell :  & mut  Shell ,  packages :  & PackageSet < ' _ > )  -> CargoResult < ( ) >  { 
506-         self . validate_packages_toml ( shell,  packages ,  & self . toml ,  true ) ?; 
507-         self . validate_packages_toml ( shell,  packages ,  & self . config ,  false ) ?; 
501+     fn  validate_packages ( & self ,  shell :  & mut  Shell ,  resolve :  & Resolve )  -> CargoResult < ( ) >  { 
502+         self . validate_packages_toml ( shell,  resolve ,  & self . toml ,  true ) ?; 
503+         self . validate_packages_toml ( shell,  resolve ,  & self . config ,  false ) ?; 
508504        Ok ( ( ) ) 
509505    } 
510506
511507    fn  validate_packages_toml ( 
512508        & self , 
513509        shell :  & mut  Shell , 
514-         packages :  & PackageSet < ' _ > , 
510+         resolve :  & Resolve , 
515511        toml :  & Option < TomlProfile > , 
516512        warn_unmatched :  bool , 
517513    )  -> CargoResult < ( ) >  { 
@@ -525,7 +521,7 @@ impl ProfileMaker {
525521        } ; 
526522        // Verify that a package doesn't match multiple spec overrides. 
527523        let  mut  found = HashSet :: new ( ) ; 
528-         for  pkg_id in  packages . package_ids ( )  { 
524+         for  pkg_id in  resolve . iter ( )  { 
529525            let  matches:  Vec < & PackageIdSpec >  = overrides
530526                . keys ( ) 
531527                . filter_map ( |key| match  * key { 
@@ -575,8 +571,8 @@ impl ProfileMaker {
575571        } ) ; 
576572        for  spec in  missing_specs { 
577573            // See if there is an exact name match. 
578-             let  name_matches:  Vec < String >  = packages 
579-                 . package_ids ( ) 
574+             let  name_matches:  Vec < String >  = resolve 
575+                 . iter ( ) 
580576                . filter_map ( |pkg_id| { 
581577                    if  pkg_id. name ( )  == spec. name ( )  { 
582578                        Some ( pkg_id. to_string ( ) ) 
@@ -586,8 +582,7 @@ impl ProfileMaker {
586582                } ) 
587583                . collect ( ) ; 
588584            if  name_matches. is_empty ( )  { 
589-                 let  suggestion =
590-                     closest_msg ( & spec. name ( ) ,  packages. package_ids ( ) ,  |p| p. name ( ) . as_str ( ) ) ; 
585+                 let  suggestion = closest_msg ( & spec. name ( ) ,  resolve. iter ( ) ,  |p| p. name ( ) . as_str ( ) ) ; 
591586                shell. warn ( format ! ( 
592587                    "package profile spec `{}` did not match any packages{}" , 
593588                    spec,  suggestion
0 commit comments