@@ -2045,7 +2045,12 @@ impl TomlManifest {
20452045 let mut inheritable = toml_config. package . clone ( ) . unwrap_or_default ( ) ;
20462046 inheritable. update_ws_path ( package_root. to_path_buf ( ) ) ;
20472047 inheritable. update_deps ( toml_config. dependencies . clone ( ) ) ;
2048- let lints = parse_unstable_lints ( toml_config. lints . clone ( ) , & features, config) ?;
2048+ let lints = parse_unstable_lints (
2049+ toml_config. lints . clone ( ) ,
2050+ & features,
2051+ config,
2052+ & mut warnings,
2053+ ) ?;
20492054 let lints = verify_lints ( lints) ?;
20502055 inheritable. update_lints ( lints) ;
20512056 if let Some ( ws_deps) = & inheritable. dependencies {
@@ -2311,10 +2316,14 @@ impl TomlManifest {
23112316 & inherit_cell,
23122317 ) ?;
23132318
2314- let lints =
2315- parse_unstable_lints :: < MaybeWorkspaceLints > ( me. lints . clone ( ) , & features, config) ?
2316- . map ( |mw| mw. resolve ( "lints" , || inherit ( ) ?. lints ( ) ) )
2317- . transpose ( ) ?;
2319+ let lints = parse_unstable_lints :: < MaybeWorkspaceLints > (
2320+ me. lints . clone ( ) ,
2321+ & features,
2322+ config,
2323+ cx. warnings ,
2324+ ) ?
2325+ . map ( |mw| mw. resolve ( "lints" , || inherit ( ) ?. lints ( ) ) )
2326+ . transpose ( ) ?;
23182327 let lints = verify_lints ( lints) ?;
23192328 let default = TomlLints :: default ( ) ;
23202329 let mut rustflags = lints
@@ -2774,7 +2783,12 @@ impl TomlManifest {
27742783 let mut inheritable = toml_config. package . clone ( ) . unwrap_or_default ( ) ;
27752784 inheritable. update_ws_path ( root. to_path_buf ( ) ) ;
27762785 inheritable. update_deps ( toml_config. dependencies . clone ( ) ) ;
2777- let lints = parse_unstable_lints ( toml_config. lints . clone ( ) , & features, config) ?;
2786+ let lints = parse_unstable_lints (
2787+ toml_config. lints . clone ( ) ,
2788+ & features,
2789+ config,
2790+ & mut warnings,
2791+ ) ?;
27782792 let lints = verify_lints ( lints) ?;
27792793 inheritable. update_lints ( lints) ;
27802794 let ws_root_config = WorkspaceRootConfig :: new (
@@ -2925,18 +2939,19 @@ fn parse_unstable_lints<T: Deserialize<'static>>(
29252939 lints : Option < toml:: Value > ,
29262940 features : & Features ,
29272941 config : & Config ,
2942+ warnings : & mut Vec < String > ,
29282943) -> CargoResult < Option < T > > {
29292944 let Some ( lints) = lints else { return Ok ( None ) ; } ;
29302945
29312946 if !features. is_enabled ( Feature :: lints ( ) ) {
2932- warn_for_feature ( "lints" , config) ;
2947+ warn_for_feature ( "lints" , config, warnings ) ;
29332948 return Ok ( None ) ;
29342949 }
29352950
29362951 lints. try_into ( ) . map ( Some ) . map_err ( |err| err. into ( ) )
29372952}
29382953
2939- fn warn_for_feature ( name : & str , config : & Config ) {
2954+ fn warn_for_feature ( name : & str , config : & Config , warnings : & mut Vec < String > ) {
29402955 use std:: fmt:: Write as _;
29412956
29422957 let mut message = String :: new ( ) ;
@@ -2962,7 +2977,7 @@ switch to nightly channel you can add
29622977`cargo-features = [\" {name}\" ]` to enable this feature" ,
29632978 ) ;
29642979 }
2965- let _ = config . shell ( ) . warn ( & message) ;
2980+ warnings . push ( message) ;
29662981}
29672982
29682983fn verify_lints ( lints : Option < TomlLints > ) -> CargoResult < Option < TomlLints > > {
0 commit comments