From d3e1bf96dacab3e5c7c86321eb79fc916b28db87 Mon Sep 17 00:00:00 2001 From: Ralf Jung Date: Tue, 25 Jun 2019 09:42:25 +0200 Subject: [PATCH] nits --- src/libcore/intrinsics.rs | 2 +- src/librustc_codegen_llvm/metadata.rs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/libcore/intrinsics.rs b/src/libcore/intrinsics.rs index 2d47f08d70154..d9b68612785e9 100644 --- a/src/libcore/intrinsics.rs +++ b/src/libcore/intrinsics.rs @@ -1336,7 +1336,7 @@ extern "rust-intrinsic" { /// Checks whether `ptr` is properly aligned with respect to /// `align_of::()`. pub(crate) fn is_aligned_and_not_null(ptr: *const T) -> bool { - return !ptr.is_null() && ptr as usize % mem::align_of::() == 0; + !ptr.is_null() && ptr as usize % mem::align_of::() == 0 } /// Checks whether the regions of memory starting at `src` and `dst` of size diff --git a/src/librustc_codegen_llvm/metadata.rs b/src/librustc_codegen_llvm/metadata.rs index 42e91ef408f9d..cd7255888118c 100644 --- a/src/librustc_codegen_llvm/metadata.rs +++ b/src/librustc_codegen_llvm/metadata.rs @@ -69,7 +69,7 @@ fn search_meta_section<'a>(of: &'a ObjectFile, let mut name_buf = None; let name_len = llvm::LLVMRustGetSectionName(si.llsi, &mut name_buf); let name = name_buf.map_or( - String::new(), // we got a NULL ptr, ignore `name_len` + String::new(), // We got a NULL ptr, ignore `name_len`. |buf| String::from_utf8( slice::from_raw_parts(buf.as_ptr() as *const u8, name_len as usize)