File tree 2 files changed +27
-3
lines changed
2 files changed +27
-3
lines changed Original file line number Diff line number Diff line change @@ -807,9 +807,16 @@ impl<'cfg> DrainState<'cfg> {
807
807
}
808
808
809
809
fn emit_future_incompat ( & mut self , cx : & mut Context < ' _ , ' _ > ) {
810
- if cx. bcx . config . cli_unstable ( ) . enable_future_incompat_feature
811
- && !self . per_crate_future_incompat_reports . is_empty ( )
812
- {
810
+ if cx. bcx . config . cli_unstable ( ) . enable_future_incompat_feature {
811
+ if self . per_crate_future_incompat_reports . is_empty ( ) {
812
+ drop (
813
+ cx. bcx
814
+ . config
815
+ . shell ( )
816
+ . note ( "0 dependencies had future-incompat warnings" ) ,
817
+ ) ;
818
+ return ;
819
+ }
813
820
self . per_crate_future_incompat_reports
814
821
. sort_by_key ( |r| r. package_id ) ;
815
822
Original file line number Diff line number Diff line change @@ -51,6 +51,23 @@ fn gate_future_incompat_report() {
51
51
. run ( ) ;
52
52
}
53
53
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
+
54
71
#[ cargo_test]
55
72
fn test_single_crate ( ) {
56
73
if !is_nightly ( ) {
You can’t perform that action at this time.
0 commit comments