Skip to content

Commit 61932e1

Browse files
committed
Avoid an unnecessary intermediate &mut reference
The `NonNull::as_mut` method returns a mut *reference*, rather than the mut *pointer* that is intended here.
1 parent 44f5ec7 commit 61932e1

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

compiler/rustc_codegen_llvm/src/back/owned_target_machine.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ impl Drop for OwnedTargetMachine {
9999
// llvm::LLVMRustCreateTargetMachine OwnedTargetMachine is not copyable so there is no
100100
// double free or use after free.
101101
unsafe {
102-
llvm::LLVMRustDisposeTargetMachine(self.tm_unique.as_mut());
102+
llvm::LLVMRustDisposeTargetMachine(self.tm_unique.as_ptr());
103103
}
104104
}
105105
}

0 commit comments

Comments
 (0)