Rollup merge of #130114 - eduardosm:needless-returns, r=compiler-errors

Remove needless returns detected by clippy in the compiler
This commit is contained in:
Jubilee 2024-09-11 15:53:22 -07:00 committed by GitHub
commit a31a8fe0cf
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
38 changed files with 66 additions and 75 deletions

View file

@ -438,7 +438,7 @@ fn link_rlib<'a>(
ab.add_file(&lib)
}
return Ok(ab);
Ok(ab)
}
/// Extract all symbols defined in raw-dylib libraries, collated by library name.
@ -1319,7 +1319,7 @@ fn link_sanitizer_runtime(
fn find_sanitizer_runtime(sess: &Session, filename: &str) -> PathBuf {
let path = sess.target_tlib_path.dir.join(filename);
if path.exists() {
return sess.target_tlib_path.dir.clone();
sess.target_tlib_path.dir.clone()
} else {
let default_sysroot =
filesearch::get_or_default_sysroot().expect("Failed finding sysroot");
@ -1327,7 +1327,7 @@ fn link_sanitizer_runtime(
&default_sysroot,
sess.opts.target_triple.triple(),
);
return default_tlib;
default_tlib
}
}

View file

@ -1484,7 +1484,6 @@ impl<'a> Linker for L4Bender<'a> {
fn export_symbols(&mut self, _: &Path, _: CrateType, _: &[String]) {
// ToDo, not implemented, copy from GCC
self.sess.dcx().emit_warn(errors::L4BenderExportingSymbolsUnimplemented);
return;
}
fn subsystem(&mut self, subsystem: &str) {

View file

@ -171,10 +171,10 @@ pub(super) fn get_metadata_xcoff<'a>(path: &Path, data: &'a [u8]) -> Result<&'a
"Metadata at offset {offset} with size {len} is beyond .info section"
));
}
return Ok(&info_data[offset..(offset + len)]);
Ok(&info_data[offset..(offset + len)])
} else {
return Err(format!("Unable to find symbol {AIX_METADATA_SYMBOL_NAME}"));
};
Err(format!("Unable to find symbol {AIX_METADATA_SYMBOL_NAME}"))
}
}
pub(crate) fn create_object_file(sess: &Session) -> Option<write::Object<'static>> {
@ -413,7 +413,7 @@ fn macho_object_build_version_for_target(target: &Target) -> object::write::Mach
/// Is Apple's CPU subtype `arm64e`s
fn macho_is_arm64e(target: &Target) -> bool {
return target.llvm_target.starts_with("arm64e");
target.llvm_target.starts_with("arm64e")
}
pub enum MetadataPosition {