@@ -63,7 +63,7 @@ use std::io::{BufRead, Write};
63
63
use std:: path:: { Path , PathBuf } ;
64
64
use std:: sync:: Arc ;
65
65
66
- use anyhow:: { bail , Context as _, Error } ;
66
+ use anyhow:: { Context as _, Error } ;
67
67
use lazycell:: LazyCell ;
68
68
use tracing:: { debug, trace} ;
69
69
@@ -743,7 +743,7 @@ fn prepare_rustdoc(build_runner: &BuildRunner<'_, '_>, unit: &Unit) -> CargoResu
743
743
let doc_dir = build_runner. files ( ) . out_dir ( unit) ;
744
744
rustdoc. arg ( "-o" ) . arg ( & doc_dir) ;
745
745
rustdoc. args ( & features_args ( unit) ) ;
746
- rustdoc. args ( & check_cfg_args ( unit) ? ) ;
746
+ rustdoc. args ( & check_cfg_args ( unit) ) ;
747
747
748
748
add_error_format_and_color ( build_runner, & mut rustdoc) ;
749
749
add_allow_features ( build_runner, & mut rustdoc) ;
@@ -1140,7 +1140,7 @@ fn build_base_args(
1140
1140
}
1141
1141
1142
1142
cmd. args ( & features_args ( unit) ) ;
1143
- cmd. args ( & check_cfg_args ( unit) ? ) ;
1143
+ cmd. args ( & check_cfg_args ( unit) ) ;
1144
1144
1145
1145
let meta = build_runner. files ( ) . metadata ( unit) ;
1146
1146
cmd. arg ( "-C" ) . arg ( & format ! ( "metadata={}" , meta) ) ;
@@ -1354,7 +1354,7 @@ fn package_remap(build_runner: &BuildRunner<'_, '_>, unit: &Unit) -> OsString {
1354
1354
}
1355
1355
1356
1356
/// Generates the `--check-cfg` arguments for the `unit`.
1357
- fn check_cfg_args ( unit : & Unit ) -> CargoResult < Vec < OsString > > {
1357
+ fn check_cfg_args ( unit : & Unit ) -> Vec < OsString > {
1358
1358
// The routine below generates the --check-cfg arguments. Our goals here are to
1359
1359
// enable the checking of conditionals and pass the list of declared features.
1360
1360
//
@@ -1391,39 +1391,12 @@ fn check_cfg_args(unit: &Unit) -> CargoResult<Vec<OsString>> {
1391
1391
// Cargo and docs.rs than rustc and docs.rs. In particular, all users of docs.rs use
1392
1392
// Cargo, but not all users of rustc (like Rust-for-Linux) use docs.rs.
1393
1393
1394
- let mut args = vec ! [
1394
+ vec ! [
1395
1395
OsString :: from( "--check-cfg" ) ,
1396
1396
OsString :: from( "cfg(docsrs)" ) ,
1397
1397
OsString :: from( "--check-cfg" ) ,
1398
1398
arg_feature,
1399
- ] ;
1400
-
1401
- // Also include the custom arguments specified in `[lints.rust.unexpected_cfgs.check_cfg]`
1402
- if let Ok ( Some ( lints) ) = unit. pkg . manifest ( ) . normalized_toml ( ) . normalized_lints ( ) {
1403
- if let Some ( rust_lints) = lints. get ( "rust" ) {
1404
- if let Some ( unexpected_cfgs) = rust_lints. get ( "unexpected_cfgs" ) {
1405
- if let Some ( config) = unexpected_cfgs. config ( ) {
1406
- if let Some ( check_cfg) = config. get ( "check-cfg" ) {
1407
- if let Ok ( check_cfgs) =
1408
- toml:: Value :: try_into :: < Vec < String > > ( check_cfg. clone ( ) )
1409
- {
1410
- for check_cfg in check_cfgs {
1411
- args. push ( OsString :: from ( "--check-cfg" ) ) ;
1412
- args. push ( OsString :: from ( check_cfg) ) ;
1413
- }
1414
- // error about `check-cfg` not being a list-of-string
1415
- } else {
1416
- bail ! (
1417
- "`lints.rust.unexpected_cfgs.check-cfg` must be a list of string"
1418
- ) ;
1419
- }
1420
- }
1421
- }
1422
- }
1423
- }
1424
- }
1425
-
1426
- Ok ( args)
1399
+ ]
1427
1400
}
1428
1401
1429
1402
/// Adds LTO related codegen flags.
0 commit comments