mirror of
				https://github.com/rust-lang/cargo.git
				synced 2025-11-03 13:12:53 +00:00 
			
		
		
		
	Emit note when --future-incompat-report had nothing to report
				
					
				
			This commit is contained in:
		
							parent
							
								
									32da9eaa5d
								
							
						
					
					
						commit
						f9512ff822
					
				@ -807,9 +807,16 @@ impl<'cfg> DrainState<'cfg> {
 | 
				
			|||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    fn emit_future_incompat(&mut self, cx: &mut Context<'_, '_>) {
 | 
					    fn emit_future_incompat(&mut self, cx: &mut Context<'_, '_>) {
 | 
				
			||||||
        if cx.bcx.config.cli_unstable().enable_future_incompat_feature
 | 
					        if cx.bcx.config.cli_unstable().enable_future_incompat_feature {
 | 
				
			||||||
            && !self.per_crate_future_incompat_reports.is_empty()
 | 
					            if self.per_crate_future_incompat_reports.is_empty() {
 | 
				
			||||||
        {
 | 
					                drop(
 | 
				
			||||||
 | 
					                    cx.bcx
 | 
				
			||||||
 | 
					                        .config
 | 
				
			||||||
 | 
					                        .shell()
 | 
				
			||||||
 | 
					                        .note("0 dependencies had future-incompat warnings"),
 | 
				
			||||||
 | 
					                );
 | 
				
			||||||
 | 
					                return;
 | 
				
			||||||
 | 
					            }
 | 
				
			||||||
            self.per_crate_future_incompat_reports
 | 
					            self.per_crate_future_incompat_reports
 | 
				
			||||||
                .sort_by_key(|r| r.package_id);
 | 
					                .sort_by_key(|r| r.package_id);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
				
			|||||||
@ -51,6 +51,23 @@ fn gate_future_incompat_report() {
 | 
				
			|||||||
        .run();
 | 
					        .run();
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					#[cargo_test]
 | 
				
			||||||
 | 
					fn test_zero_future_incompat() {
 | 
				
			||||||
 | 
					    if !is_nightly() {
 | 
				
			||||||
 | 
					        return;
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    let p = project()
 | 
				
			||||||
 | 
					        .file("Cargo.toml", &basic_manifest("foo", "0.0.0"))
 | 
				
			||||||
 | 
					        .file("src/main.rs", "fn main() {}")
 | 
				
			||||||
 | 
					        .build();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    p.cargo("build --future-incompat-report -Z unstable-options -Z future-incompat-report")
 | 
				
			||||||
 | 
					        .masquerade_as_nightly_cargo()
 | 
				
			||||||
 | 
					        .with_stderr_contains("note: 0 dependencies had future-incompat warnings")
 | 
				
			||||||
 | 
					        .run();
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#[cargo_test]
 | 
					#[cargo_test]
 | 
				
			||||||
fn test_single_crate() {
 | 
					fn test_single_crate() {
 | 
				
			||||||
    if !is_nightly() {
 | 
					    if !is_nightly() {
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user