File tree Expand file tree Collapse file tree 1 file changed +49
-0
lines changed
Expand file tree Collapse file tree 1 file changed +49
-0
lines changed Original file line number Diff line number Diff line change @@ -438,6 +438,55 @@ fn test_proc_macro() {
438438 . run ( ) ;
439439}
440440
441+ #[ cargo_test( build_std_real) ]
442+ fn build_std_does_not_warn_about_implicit_std_deps ( ) {
443+ let p = project ( )
444+ . file (
445+ "Cargo.toml" ,
446+ r#"
447+ [package]
448+ name = "buildstd_test"
449+ version = "0.1.0"
450+ edition = "2021"
451+
452+ [dependencies]
453+ bar = { path = "bar" }
454+ "# ,
455+ )
456+ . file ( "src/main.rs" , "fn main() {}" )
457+ . file (
458+ "bar/Cargo.toml" ,
459+ r#"
460+ [package]
461+ name = "bar"
462+ version = "0.1.0"
463+ edition = "2021"
464+ "# ,
465+ )
466+ . file ( "bar/src/lib.rs" , "" )
467+ . build ( ) ;
468+
469+ p. cargo ( "build" )
470+ . build_std ( )
471+ . target_host ( )
472+ . env ( "RUSTFLAGS" , "-W unused-crate-dependencies" )
473+ . with_stderr_data (
474+ str![ [ r#"
475+ [WARNING] extern crate `alloc` is unused in crate `bar`
476+ [WARNING] extern crate `alloc` is unused in crate `buildstd_test`
477+ [WARNING] extern crate `bar` is unused in crate `buildstd_test`
478+ [WARNING] extern crate `compiler_builtins` is unused in crate `buildstd_test`
479+ [WARNING] extern crate `core` is unused in crate `buildstd_test`
480+ [WARNING] extern crate `proc_macro` is unused in crate `buildstd_test`
481+ [WARNING] `buildstd_test` (bin "buildstd_test") generated 5 warnings
482+ ...
483+
484+ "# ] ]
485+ . unordered ( ) ,
486+ )
487+ . run ( ) ;
488+ }
489+
441490#[ cargo_test( build_std_real) ]
442491fn default_features_still_included_with_extra_build_std_features ( ) {
443492 // This is a regression test to ensure when adding extra `build-std-features`,
You can’t perform that action at this time.
0 commit comments