@@ -2045,7 +2045,12 @@ impl TomlManifest {
2045
2045
let mut inheritable = toml_config. package . clone ( ) . unwrap_or_default ( ) ;
2046
2046
inheritable. update_ws_path ( package_root. to_path_buf ( ) ) ;
2047
2047
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
+ ) ?;
2049
2054
let lints = verify_lints ( lints) ?;
2050
2055
inheritable. update_lints ( lints) ;
2051
2056
if let Some ( ws_deps) = & inheritable. dependencies {
@@ -2311,10 +2316,14 @@ impl TomlManifest {
2311
2316
& inherit_cell,
2312
2317
) ?;
2313
2318
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 ( ) ?;
2318
2327
let lints = verify_lints ( lints) ?;
2319
2328
let default = TomlLints :: default ( ) ;
2320
2329
let mut rustflags = lints
@@ -2774,7 +2783,12 @@ impl TomlManifest {
2774
2783
let mut inheritable = toml_config. package . clone ( ) . unwrap_or_default ( ) ;
2775
2784
inheritable. update_ws_path ( root. to_path_buf ( ) ) ;
2776
2785
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
+ ) ?;
2778
2792
let lints = verify_lints ( lints) ?;
2779
2793
inheritable. update_lints ( lints) ;
2780
2794
let ws_root_config = WorkspaceRootConfig :: new (
@@ -2925,18 +2939,19 @@ fn parse_unstable_lints<T: Deserialize<'static>>(
2925
2939
lints : Option < toml:: Value > ,
2926
2940
features : & Features ,
2927
2941
config : & Config ,
2942
+ warnings : & mut Vec < String > ,
2928
2943
) -> CargoResult < Option < T > > {
2929
2944
let Some ( lints) = lints else { return Ok ( None ) ; } ;
2930
2945
2931
2946
if !features. is_enabled ( Feature :: lints ( ) ) {
2932
- warn_for_feature ( "lints" , config) ;
2947
+ warn_for_feature ( "lints" , config, warnings ) ;
2933
2948
return Ok ( None ) ;
2934
2949
}
2935
2950
2936
2951
lints. try_into ( ) . map ( Some ) . map_err ( |err| err. into ( ) )
2937
2952
}
2938
2953
2939
- fn warn_for_feature ( name : & str , config : & Config ) {
2954
+ fn warn_for_feature ( name : & str , config : & Config , warnings : & mut Vec < String > ) {
2940
2955
use std:: fmt:: Write as _;
2941
2956
2942
2957
let mut message = String :: new ( ) ;
@@ -2962,7 +2977,7 @@ switch to nightly channel you can add
2962
2977
`cargo-features = [\" {name}\" ]` to enable this feature" ,
2963
2978
) ;
2964
2979
}
2965
- let _ = config . shell ( ) . warn ( & message) ;
2980
+ warnings . push ( message) ;
2966
2981
}
2967
2982
2968
2983
fn verify_lints ( lints : Option < TomlLints > ) -> CargoResult < Option < TomlLints > > {
0 commit comments