diff --git a/src/librustc_interface/util.rs b/src/librustc_interface/util.rs index a86d3cc43948d..6ae5e94b11af3 100644 --- a/src/librustc_interface/util.rs +++ b/src/librustc_interface/util.rs @@ -642,14 +642,14 @@ pub fn build_output_filenames( ); None } else { + if !sess.opts.cg.extra_filename.is_empty() { + sess.warn("ignoring -C extra-filename flag due to -o flag"); + } Some(out_file.clone()) }; if *odir != None { sess.warn("ignoring --out-dir flag due to -o flag"); } - if !sess.opts.cg.extra_filename.is_empty() { - sess.warn("ignoring -C extra-filename flag due to -o flag"); - } OutputFilenames { out_directory: out_file.parent().unwrap_or_else(|| Path::new("")).to_path_buf(),