diff options
| author | Mark Rousskov <mark.simulacrum@gmail.com> | 2020-01-21 09:50:22 -0500 |
|---|---|---|
| committer | Shotaro Yamada <sinkuu@sinkuu.xyz> | 2020-01-22 08:10:05 +0900 |
| commit | d1bb7e16e0d0ad4e568df14eceedc5b0dd484214 (patch) | |
| tree | 0ec18da65c7f9b93d28c98ab800cd38d6e9b5fb8 /src/librustc_interface | |
| parent | b5a3341f1b8b475990e9d1b071b88d3c280936b4 (diff) | |
| download | rust-d1bb7e16e0d0ad4e568df14eceedc5b0dd484214.tar.gz rust-d1bb7e16e0d0ad4e568df14eceedc5b0dd484214.zip | |
Privatize private fields of OutputFilenames
Diffstat (limited to 'src/librustc_interface')
| -rw-r--r-- | src/librustc_interface/util.rs | 33 |
1 files changed, 14 insertions, 19 deletions
diff --git a/src/librustc_interface/util.rs b/src/librustc_interface/util.rs index 21f9fa48165..3e65da9c47b 100644 --- a/src/librustc_interface/util.rs +++ b/src/librustc_interface/util.rs @@ -550,13 +550,13 @@ pub fn build_output_filenames( .or_else(|| attr::find_crate_name(attrs).map(|n| n.to_string())) .unwrap_or_else(|| input.filestem().to_owned()); - OutputFilenames { - out_directory: dirpath, - out_filestem: stem, - single_output_file: None, - extra: sess.opts.cg.extra_filename.clone(), - outputs: sess.opts.output_types.clone(), - } + OutputFilenames::new( + dirpath, + stem, + None, + sess.opts.cg.extra_filename.clone(), + sess.opts.output_types.clone(), + ) } Some(ref out_file) => { @@ -578,18 +578,13 @@ pub fn build_output_filenames( sess.warn("ignoring --out-dir flag due to -o flag"); } - OutputFilenames { - out_directory: out_file.parent().unwrap_or_else(|| Path::new("")).to_path_buf(), - out_filestem: out_file - .file_stem() - .unwrap_or_default() - .to_str() - .unwrap() - .to_string(), - single_output_file: ofile, - extra: sess.opts.cg.extra_filename.clone(), - outputs: sess.opts.output_types.clone(), - } + OutputFilenames::new( + out_file.parent().unwrap_or_else(|| Path::new("")).to_path_buf(), + out_file.file_stem().unwrap_or_default().to_str().unwrap().to_string(), + ofile, + sess.opts.cg.extra_filename.clone(), + sess.opts.output_types.clone(), + ) } } } |
