diff options
| author | Guillaume Gomez <guillaume1.gomez@gmail.com> | 2025-06-16 15:34:09 +0200 |
|---|---|---|
| committer | Guillaume Gomez <guillaume1.gomez@gmail.com> | 2025-06-16 17:01:56 +0200 |
| commit | fec46a44ba01a6e1df5c2e54621fcfc2b2f7d236 (patch) | |
| tree | ff4ada518b11d69a11608390164ee6ec03d03f85 /src | |
| parent | 46c14b7b3ffe35c8c708cf141b379ea76364784c (diff) | |
| download | rust-fec46a44ba01a6e1df5c2e54621fcfc2b2f7d236.tar.gz rust-fec46a44ba01a6e1df5c2e54621fcfc2b2f7d236.zip | |
Fix clippy lints
Diffstat (limited to 'src')
| -rw-r--r-- | src/intrinsic/llvm.rs | 2 | ||||
| -rw-r--r-- | src/type_.rs | 14 |
2 files changed, 8 insertions, 8 deletions
diff --git a/src/intrinsic/llvm.rs b/src/intrinsic/llvm.rs index 97b94428187..0b77694f115 100644 --- a/src/intrinsic/llvm.rs +++ b/src/intrinsic/llvm.rs @@ -1012,7 +1012,7 @@ pub fn intrinsic<'gcc, 'tcx>(name: &str, cx: &CodegenCx<'gcc, 'tcx>) -> Function }; let func = cx.context.get_builtin_function(gcc_name); cx.functions.borrow_mut().insert(gcc_name.to_string(), func); - return func; + func } #[cfg(feature = "master")] diff --git a/src/type_.rs b/src/type_.rs index 4e0a250b550..15a0206607e 100644 --- a/src/type_.rs +++ b/src/type_.rs @@ -302,13 +302,13 @@ impl<'gcc, 'tcx> BaseTypeCodegenMethods for CodegenCx<'gcc, 'tcx> { #[cfg_attr(feature = "master", allow(unused_mut))] fn type_array(&self, ty: Type<'gcc>, mut len: u64) -> Type<'gcc> { #[cfg(not(feature = "master"))] - if let Some(struct_type) = ty.is_struct() { - if struct_type.get_field_count() == 0 { - // NOTE: since gccjit only supports i32 for the array size and libcore's tests uses a - // size of usize::MAX in test_binary_search, we workaround this by setting the size to - // zero for ZSTs. - len = 0; - } + if let Some(struct_type) = ty.is_struct() + && struct_type.get_field_count() == 0 + { + // NOTE: since gccjit only supports i32 for the array size and libcore's tests uses a + // size of usize::MAX in test_binary_search, we workaround this by setting the size to + // zero for ZSTs. + len = 0; } self.context.new_array_type(None, ty, len) |
