File tree Expand file tree Collapse file tree 2 files changed +27
-3
lines changed Expand file tree Collapse file tree 2 files changed +27
-3
lines changed Original file line number Diff line number Diff line change @@ -808,9 +808,16 @@ impl<'cfg> DrainState<'cfg> {
808808 }
809809
810810 fn emit_future_incompat ( & mut self , cx : & mut Context < ' _ , ' _ > ) {
811- if cx. bcx . config . cli_unstable ( ) . enable_future_incompat_feature
812- && !self . per_crate_future_incompat_reports . is_empty ( )
813- {
811+ if cx. bcx . config . cli_unstable ( ) . enable_future_incompat_feature {
812+ if self . per_crate_future_incompat_reports . is_empty ( ) {
813+ drop (
814+ cx. bcx
815+ . config
816+ . shell ( )
817+ . note ( "0 dependencies had future-incompat warnings" ) ,
818+ ) ;
819+ return ;
820+ }
814821 self . per_crate_future_incompat_reports
815822 . sort_by_key ( |r| r. package_id ) ;
816823
Original file line number Diff line number Diff line change @@ -51,6 +51,23 @@ fn gate_future_incompat_report() {
5151 . run ( ) ;
5252}
5353
54+ #[ cargo_test]
55+ fn test_zero_future_incompat ( ) {
56+ if !is_nightly ( ) {
57+ return ;
58+ }
59+
60+ let p = project ( )
61+ . file ( "Cargo.toml" , & basic_manifest ( "foo" , "0.0.0" ) )
62+ . file ( "src/main.rs" , "fn main() {}" )
63+ . build ( ) ;
64+
65+ p. cargo ( "build --future-incompat-report -Z unstable-options -Z future-incompat-report" )
66+ . masquerade_as_nightly_cargo ( )
67+ . with_stderr_contains ( "note: 0 dependencies had future-incompat warnings" )
68+ . run ( ) ;
69+ }
70+
5471#[ cargo_test]
5572fn test_single_crate ( ) {
5673 if !is_nightly ( ) {
You can’t perform that action at this time.
0 commit comments