X-Git-Url: https://git.lizzy.rs/?a=blobdiff_plain;f=compiler%2Frustc_session%2Fsrc%2Foutput.rs;h=c3f0c4b58f57ad61eb04cbad7be79918950af8e3;hb=ae15d1094a1185e965a3de1672c5159546af9863;hp=8ee3057de625ef3b08c9faad46c824ae9c685130;hpb=e8fdd6912fe3aea7495ee193c74b88e5a6223a11;p=rust.git diff --git a/compiler/rustc_session/src/output.rs b/compiler/rustc_session/src/output.rs index 8ee3057de62..c3f0c4b58f5 100644 --- a/compiler/rustc_session/src/output.rs +++ b/compiler/rustc_session/src/output.rs @@ -29,9 +29,9 @@ pub fn out_filename( out_filename } -/// Make sure files are writeable. Mac, FreeBSD, and Windows system linkers +/// Make sure files are writeable. Mac, FreeBSD, and Windows system linkers /// check this already -- however, the Linux linker will happily overwrite a -/// read-only file. We should be consistent. +/// read-only file. We should be consistent. pub fn check_file_is_writeable(file: &Path, sess: &Session) { if !is_writeable(file) { sess.emit_fatal(FileIsNotWriteable { file }); @@ -45,7 +45,7 @@ fn is_writeable(p: &Path) -> bool { } } -pub fn find_crate_name(sess: &Session, attrs: &[ast::Attribute], input: &Input) -> Symbol { +pub fn find_crate_name(sess: &Session, attrs: &[ast::Attribute]) -> Symbol { let validate = |s: Symbol, span: Option| { validate_crate_name(sess, s, span); s @@ -71,7 +71,7 @@ pub fn find_crate_name(sess: &Session, attrs: &[ast::Attribute], input: &Input) if let Some((attr, s)) = attr_crate_name { return validate(s, Some(attr.span)); } - if let Input::File(ref path) = *input { + if let Input::File(ref path) = sess.io.input { if let Some(s) = path.file_stem().and_then(|s| s.to_str()) { if s.starts_with('-') { sess.emit_err(CrateNameInvalid { s });